Bullet Collision Detection & Physics Library: btUniformScalingShape Class Reference

Bullet Collision Detection & Physics Library

Public Member Functions | Private Attributes | List of all members
btUniformScalingShape Class Reference

The btUniformScalingShape allows to re-use uniform scaled instances of btConvexShape in a memory efficient way. More...

`#include <btUniformScalingShape.h>`

Inheritance diagram for btUniformScalingShape:
[legend]
Collaboration diagram for btUniformScalingShape:
[legend]

## Public Member Functions
| BT_DECLARE_ALIGNED_ALLOCATOR ()
| btUniformScalingShape (btConvexShape *convexChildShape, btScalar uniformScalingFactor)
virtual | ~btUniformScalingShape ()
virtual btVector3 | localGetSupportingVertexWithoutMargin (const btVector3 &vec) const
virtual btVector3 | localGetSupportingVertex (const btVector3 &vec) const
virtual void | batchedUnitVectorGetSupportingVertexWithoutMargin (const btVector3 *vectors, btVector3 *supportVerticesOut, int numVectors) const
virtual void | calculateLocalInertia (btScalar mass, btVector3 &inertia) const
btScalar | getUniformScalingFactor () const
btConvexShape * | getChildShape ()
const btConvexShape * | getChildShape () const
virtual const char * | getName () const
void | getAabb (const btTransform &t, btVector3 &aabbMin, btVector3 &aabbMax) const
| getAabb's default implementation is brute force, expected derived classes to implement a fast dedicated version More...
virtual void | getAabbSlow (const btTransform &t, btVector3 &aabbMin, btVector3 &aabbMax) const
virtual void | setLocalScaling (const btVector3 &scaling)
virtual const btVector3 & | getLocalScaling () const
virtual void | setMargin (btScalar margin)
virtual btScalar | getMargin () const
virtual int | getNumPreferredPenetrationDirections () const
virtual void | getPreferredPenetrationDirection (int index, btVector3 &penetrationVector) const
Public Member Functions inherited from btConvexShape
| BT_DECLARE_ALIGNED_ALLOCATOR ()
| btConvexShape ()
| not supported on IBM SDK, until we fix the alignment of btVector3 More...
virtual | ~btConvexShape ()
btVector3 | localGetSupportVertexWithoutMarginNonVirtual (const btVector3 &vec) const
btVector3 | localGetSupportVertexNonVirtual (const btVector3 &vec) const
btScalar | getMarginNonVirtual () const
void | getAabbNonVirtual (const btTransform &t, btVector3 &aabbMin, btVector3 &aabbMax) const
virtual void | project (const btTransform &trans, const btVector3 &dir, btScalar &minProj, btScalar &maxProj, btVector3 &witnesPtMin, btVector3 &witnesPtMax) const
Public Member Functions inherited from btCollisionShape
| BT_DECLARE_ALIGNED_ALLOCATOR ()
| btCollisionShape ()
virtual | ~btCollisionShape ()
virtual void | getBoundingSphere (btVector3 &center, btScalar &radius) const
virtual btScalar | getAngularMotionDisc () const
| getAngularMotionDisc returns the maximus radius needed for Conservative Advancement to handle time-of-impact with rotations. More...
virtual btScalar | getContactBreakingThreshold (btScalar defaultContactThresholdFactor) const
void | calculateTemporalAabb (const btTransform &curTrans, const btVector3 &linvel, const btVector3 &angvel, btScalar timeStep, btVector3 &temporalAabbMin, btVector3 &temporalAabbMax) const
| calculateTemporalAabb calculates the enclosing aabb for the moving object over interval [0..timeStep) result is conservative More...
bool | isPolyhedral () const
bool | isConvex2d () const
bool | isConvex () const
bool | isNonMoving () const
bool | isConcave () const
bool | isCompound () const
bool | isSoftBody () const
bool | isInfinite () const
| isInfinite is used to catch simulation error (aabb check) More...
int | getShapeType () const
virtual btVector3 | getAnisotropicRollingFrictionDirection () const
| the getAnisotropicRollingFrictionDirection can be used in combination with setAnisotropicFriction See Bullet/Demos/RollingFrictionDemo for an example More...
void | setUserPointer (void *userPtr)
| optional user data pointer More...
void * | getUserPointer () const
void | setUserIndex (int index)
int | getUserIndex () const
virtual int | calculateSerializeBufferSize () const
virtual const char * | serialize (void *dataBuffer, btSerializer *serializer) const
| fills the dataBuffer and returns the struct name (and 0 on failure) More...
virtual void | serializeSingleShape (btSerializer *serializer) const

## Private Attributes
btConvexShape * | m_childConvexShape
btScalar | m_uniformScalingFactor

## Additional Inherited Members
Protected Attributes inherited from btCollisionShape
int | m_shapeType
void * | m_userPointer
int | m_userIndex

## Detailed Description

The btUniformScalingShape allows to re-use uniform scaled instances of btConvexShape in a memory efficient way.

Istead of using btUniformScalingShape, it is better to use the non-uniform setLocalScaling method on convex shapes that implement it.

Definition at line 24 of file btUniformScalingShape.h.

## Constructor & Destructor Documentation

## § btUniformScalingShape()

btUniformScalingShape::btUniformScalingShape | ( | btConvexShape * | convexChildShape,
|  | btScalar | uniformScalingFactor
| ) |  |

Definition at line 18 of file btUniformScalingShape.cpp.

## § ~btUniformScalingShape()

btUniformScalingShape::~btUniformScalingShape | ( |  | ) |
| virtual

Definition at line 25 of file btUniformScalingShape.cpp.

## Member Function Documentation

## § batchedUnitVectorGetSupportingVertexWithoutMargin()

void btUniformScalingShape::batchedUnitVectorGetSupportingVertexWithoutMargin | ( | const btVector3 * | vectors,
|  | btVector3 * | supportVerticesOut,
|  | int | numVectors
| ) |  | const
| virtual

Implements btConvexShape.

Definition at line 37 of file btUniformScalingShape.cpp.

## § BT_DECLARE_ALIGNED_ALLOCATOR()

btUniformScalingShape::BT_DECLARE_ALIGNED_ALLOCATOR | ( |  | ) |

## § calculateLocalInertia()

void btUniformScalingShape::calculateLocalInertia | ( | btScalar | mass,
|  | btVector3 & | inertia
| ) |  | const
| virtual

this linear upscaling is not realistic, but we don't deal with large mass ratios...

Implements btCollisionShape.

Definition at line 56 of file btUniformScalingShape.cpp.

## § getAabb()

void btUniformScalingShape::getAabb | ( | const btTransform & | t,
|  | btVector3 & | aabbMin,
|  | btVector3 & | aabbMax
| ) |  | const
| virtual

getAabb's default implementation is brute force, expected derived classes to implement a fast dedicated version

Implements btConvexShape.

Definition at line 67 of file btUniformScalingShape.cpp.

## § getAabbSlow()

void btUniformScalingShape::getAabbSlow | ( | const btTransform & | t,
|  | btVector3 & | aabbMin,
|  | btVector3 & | aabbMax
| ) |  | const
| virtual

Implements btConvexShape.

Definition at line 73 of file btUniformScalingShape.cpp.

## § getChildShape() [1/2]

btConvexShape* btUniformScalingShape::getChildShape | ( |  | ) |
| inline

Definition at line 51 of file btUniformScalingShape.h.

## § getChildShape() [2/2]

const btConvexShape* btUniformScalingShape::getChildShape | ( |  | ) | const
| inline

Definition at line 56 of file btUniformScalingShape.h.

## § getLocalScaling()

const btVector3 & btUniformScalingShape::getLocalScaling | ( |  | ) | const
| virtual

Implements btConvexShape.

Definition at line 138 of file btUniformScalingShape.cpp.

## § getMargin()

btScalar btUniformScalingShape::getMargin | ( |  | ) | const
| virtual

Implements btConvexShape.

Definition at line 147 of file btUniformScalingShape.cpp.

## § getName()

virtual const char* btUniformScalingShape::getName | ( |  | ) | const
| inlinevirtual

Implements btCollisionShape.

Definition at line 61 of file btUniformScalingShape.h.

## § getNumPreferredPenetrationDirections()

int btUniformScalingShape::getNumPreferredPenetrationDirections | ( |  | ) | const
| virtual

Implements btConvexShape.

Definition at line 152 of file btUniformScalingShape.cpp.

## § getPreferredPenetrationDirection()

void btUniformScalingShape::getPreferredPenetrationDirection | ( | int | index,
|  | btVector3 & | penetrationVector
| ) |  | const
| virtual

Implements btConvexShape.

Definition at line 157 of file btUniformScalingShape.cpp.

## § getUniformScalingFactor()

btScalar btUniformScalingShape::getUniformScalingFactor | ( |  | ) | const
| inline

Definition at line 46 of file btUniformScalingShape.h.

## § localGetSupportingVertex()

btVector3 btUniformScalingShape::localGetSupportingVertex | ( | const btVector3 & | vec | ) | const
| virtual

Implements btConvexShape.

Definition at line 48 of file btUniformScalingShape.cpp.

## § localGetSupportingVertexWithoutMargin()

btVector3 btUniformScalingShape::localGetSupportingVertexWithoutMargin | ( | const btVector3 & | vec | ) | const
| virtual

Implements btConvexShape.

Definition at line 30 of file btUniformScalingShape.cpp.

## § setLocalScaling()

void btUniformScalingShape::setLocalScaling | ( | const btVector3 & | scaling | ) |
| virtual

Implements btConvexShape.

Definition at line 133 of file btUniformScalingShape.cpp.

## § setMargin()

void btUniformScalingShape::setMargin | ( | btScalar | margin | ) |
| virtual

Implements btConvexShape.

Definition at line 143 of file btUniformScalingShape.cpp.

## Member Data Documentation

## § m_childConvexShape

btConvexShape* btUniformScalingShape::m_childConvexShape
| private

Definition at line 26 of file btUniformScalingShape.h.

## § m_uniformScalingFactor

btScalar btUniformScalingShape::m_uniformScalingFactor
| private

Definition at line 28 of file btUniformScalingShape.h.

The documentation for this class was generated from the following files:

- btUniformScalingShape.h
- btUniformScalingShape.cpp