Bullet Collision Detection & Physics Library: btGImpactCompoundShape Class Reference

Bullet Collision Detection & Physics Library

- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Hierarchy
- Class Members

Classes | Public Member Functions | Protected Attributes | List of all members
btGImpactCompoundShape Class Reference

btGImpactCompoundShape allows to handle multiple btCollisionShape objects at once More...

`#include <btGImpactShape.h>`

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

## Classes
class | CompoundPrimitiveManager
| compound primitive manager More...

## Public Member Functions
| btGImpactCompoundShape (bool children_has_transform=true)
virtual | ~btGImpactCompoundShape ()
virtual bool | childrenHasTransform () const
| if true, then its children must get transforms.
virtual const btPrimitiveManagerBase * | getPrimitiveManager () const
| Obtains the primitive manager.
CompoundPrimitiveManager * | getCompoundPrimitiveManager ()
| Obtains the compopund primitive manager.
virtual int | getNumChildShapes () const
| Gets the number of children.
void | addChildShape (const btTransform &localTransform, btCollisionShape *shape)
| Use this method for adding children. Only Convex shapes are allowed.
void | addChildShape (btCollisionShape *shape)
| Use this method for adding children. Only Convex shapes are allowed.
virtual btCollisionShape * | getChildShape (int index)
| Gets the children.
virtual const btCollisionShape * | getChildShape (int index) const
| Gets the children.
virtual void | getChildAabb (int child_index, const btTransform &t, btVector3 &aabbMin, btVector3 &aabbMax) const
| Retrieves the bound from a child.
virtual btTransform | getChildTransform (int index) const
| Gets the children transform.
virtual void | setChildTransform (int index, const btTransform &transform)
| Sets the children transform.
virtual bool | needsRetrieveTriangles () const
| Determines if this shape has triangles.
virtual bool | needsRetrieveTetrahedrons () const
| Determines if this shape has tetrahedrons.
virtual void | getBulletTriangle (int prim_index, btTriangleShapeEx &triangle) const
virtual void | getBulletTetrahedron (int prim_index, btTetrahedronShapeEx &tetrahedron) const
virtual void | calculateLocalInertia (btScalar mass, btVector3 &inertia) const
| Calculates the exact inertia tensor for this shape.
virtual const char * | getName () const
virtual eGIMPACT_SHAPE_TYPE | getGImpactShapeType () const
| Subshape member functions.
Public Member Functions inherited from btGImpactShapeInterface
| btGImpactShapeInterface ()
void | updateBound ()
| performs refit operation
void | getAabb (const btTransform &t, btVector3 &aabbMin, btVector3 &aabbMax) const
| If the Bounding box is not updated, then this class attemps to calculate it.
virtual void | postUpdate ()
| Tells to this object that is needed to refit the box set.
const btAABB & | getLocalBox ()
| Obtains the local box, which is the global calculated box of the total of subshapes.
virtual int | getShapeType () const
virtual void | setLocalScaling (const btVector3 &scaling)
virtual const btVector3 & | getLocalScaling () const
virtual void | setMargin (btScalar margin)
virtual void | rayTest (const btVector3 &rayFrom, const btVector3 &rayTo, btCollisionWorld::RayResultCallback &resultCallback) const
| virtual method for ray collision
virtual void | processAllTriangles (btTriangleCallback *callback, const btVector3 &aabbMin, const btVector3 &aabbMax) const
| Function for retrieve triangles.
virtual void | processAllTrianglesRay (btTriangleCallback *, const btVector3 &, const btVector3 &) const
| Function for retrieve triangles.
const btGImpactBoxSet * | getBoxSet () const
| gets boxset
bool | hasBoxSet () const
| Determines if this class has a hierarchy structure for sorting its primitives.
virtual void | lockChildShapes () const
| call when reading child shapes
virtual void | unlockChildShapes () const
void | getPrimitiveTriangle (int index, btPrimitiveTriangle &triangle) const
| if this trimesh
Public Member Functions inherited from btConcaveShape
| BT_DECLARE_ALIGNED_ALLOCATOR ()
| btConcaveShape ()
virtual | ~btConcaveShape ()
virtual void | processAllTriangles (btTriangleCallback *callback, const btVector3 &aabbMin, const btVector3 &aabbMax) const =0
virtual btScalar | getMargin () const
virtual void | setMargin (btScalar collisionMargin)
Public Member Functions inherited from btCollisionShape
| BT_DECLARE_ALIGNED_ALLOCATOR ()
| btCollisionShape ()
virtual | ~btCollisionShape ()
virtual void | getAabb (const btTransform &t, btVector3 &aabbMin, btVector3 &aabbMax) const =0
| getAabb returns the axis aligned bounding box in the coordinate frame of the given transform t.
virtual void | getBoundingSphere (btVector3 &center, btScalar &radius) const
virtual btScalar | getAngularMotionDisc () const
| getAngularMotionDisc returns the maximum radius needed for Conservative Advancement to handle time-of-impact with rotations.
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
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)
virtual void | setLocalScaling (const btVector3 &scaling)=0
virtual const btVector3 & | getLocalScaling () const =0
virtual void | calculateLocalInertia (btScalar mass, btVector3 &inertia) const =0
virtual const char * | getName () const =0
int | getShapeType () const
virtual btVector3 | getAnisotropicRollingFrictionDirection () const
| the getAnisotropicRollingFrictionDirection can be used in combination with setAnisotropicFriction See Bullet/Demos/RollingFrictionDemo for an example
virtual void | setMargin (btScalar margin)=0
virtual btScalar | getMargin () const =0
void | setUserPointer (void *userPtr)
| optional user data pointer
void * | getUserPointer () const
void | setUserIndex (int index)
int | getUserIndex () const
void | setUserIndex2 (int index)
int | getUserIndex2 () 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)
virtual void | serializeSingleShape (btSerializer *serializer) const

## Protected Attributes
CompoundPrimitiveManager | m_primitive_manager
btAlignedObjectArray< btTransform > | m_childTransforms
btAlignedObjectArray< btCollisionShape * > | m_childShapes
Protected Attributes inherited from btGImpactShapeInterface
btAABB | m_localAABB
bool | m_needs_update
btVector3 | localScaling
btGImpactBoxSet | m_box_set
Protected Attributes inherited from btConcaveShape
btScalar | m_collisionMargin
Protected Attributes inherited from btCollisionShape
int | m_shapeType
void * | m_userPointer
int | m_userIndex
int | m_userIndex2

## Additional Inherited Members
Protected Member Functions inherited from btGImpactShapeInterface
virtual void | calcLocalAABB ()
| use this function for perfofm refit in bounding boxes use this function for perfofm refit in bounding boxes

## Detailed Description

btGImpactCompoundShape allows to handle multiple btCollisionShape objects at once

This class only can manage Convex subshapes

Definition at line 294 of file btGImpactShape.h.

## Constructor & Destructor Documentation

## ◆ btGImpactCompoundShape()

btGImpactCompoundShape::btGImpactCompoundShape | ( | bool | children_has_transform = `true` | ) |
| inline

Definition at line 359 of file btGImpactShape.h.

## ◆ ~btGImpactCompoundShape()

virtual btGImpactCompoundShape::~btGImpactCompoundShape | ( |  | ) |
| inlinevirtual

Definition at line 366 of file btGImpactShape.h.

## Member Function Documentation

## ◆ addChildShape() [1/2]

void btGImpactCompoundShape::addChildShape | ( | btCollisionShape * | shape | ) |
| inline

Use this method for adding children. Only Convex shapes are allowed.

Definition at line 404 of file btGImpactShape.h.

## ◆ addChildShape() [2/2]

void btGImpactCompoundShape::addChildShape | ( | const btTransform & | localTransform,
|  | btCollisionShape * | shape
| ) |  |
| inline

Use this method for adding children. Only Convex shapes are allowed.

Definition at line 396 of file btGImpactShape.h.

## ◆ calculateLocalInertia()

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

Calculates the exact inertia tensor for this shape.

Implements btCollisionShape.

Definition at line 78 of file btGImpactShape.cpp.

## ◆ childrenHasTransform()

virtual bool btGImpactCompoundShape::childrenHasTransform | ( |  | ) | const
| inlinevirtual

if true, then its children must get transforms.

Implements btGImpactShapeInterface.

Definition at line 371 of file btGImpactShape.h.

## ◆ getBulletTetrahedron()

virtual void btGImpactCompoundShape::getBulletTetrahedron | ( | int | prim_index,
|  | btTetrahedronShapeEx & | tetrahedron
| ) |  | const
| inlinevirtual

Implements btGImpactShapeInterface.

Definition at line 474 of file btGImpactShape.h.

## ◆ getBulletTriangle()

virtual void btGImpactCompoundShape::getBulletTriangle | ( | int | prim_index,
|  | btTriangleShapeEx & | triangle
| ) |  | const
| inlinevirtual

Implements btGImpactShapeInterface.

Definition at line 467 of file btGImpactShape.h.

## ◆ getChildAabb()

virtual void btGImpactCompoundShape::getChildAabb | ( | int | child_index,
|  | const btTransform & | t,
|  | btVector3 & | aabbMin,
|  | btVector3 & | aabbMax
| ) |  | const
| inlinevirtual

Retrieves the bound from a child.

Reimplemented from btGImpactShapeInterface.

Definition at line 425 of file btGImpactShape.h.

## ◆ getChildShape() [1/2]

virtual btCollisionShape * btGImpactCompoundShape::getChildShape | ( | int | index | ) |
| inlinevirtual

Gets the children.

Implements btGImpactShapeInterface.

Definition at line 411 of file btGImpactShape.h.

## ◆ getChildShape() [2/2]

virtual const btCollisionShape * btGImpactCompoundShape::getChildShape | ( | int | index | ) | const
| inlinevirtual

Gets the children.

Implements btGImpactShapeInterface.

Definition at line 417 of file btGImpactShape.h.

## ◆ getChildTransform()

virtual btTransform btGImpactCompoundShape::getChildTransform | ( | int | index | ) | const
| inlinevirtual

Gets the children transform.

Implements btGImpactShapeInterface.

Definition at line 438 of file btGImpactShape.h.

## ◆ getCompoundPrimitiveManager()

CompoundPrimitiveManager * btGImpactCompoundShape::getCompoundPrimitiveManager | ( |  | ) |
| inline

Obtains the compopund primitive manager.

Definition at line 384 of file btGImpactShape.h.

## ◆ getGImpactShapeType()

virtual eGIMPACT_SHAPE_TYPE btGImpactCompoundShape::getGImpactShapeType | ( |  | ) | const
| inlinevirtual

Subshape member functions.

Base method for determinig which kind of GIMPACT shape we get

Implements btGImpactShapeInterface.

Definition at line 489 of file btGImpactShape.h.

## ◆ getName()

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

Implements btCollisionShape.

Definition at line 484 of file btGImpactShape.h.

## ◆ getNumChildShapes()

virtual int btGImpactCompoundShape::getNumChildShapes | ( |  | ) | const
| inlinevirtual

Gets the number of children.

Implements btGImpactShapeInterface.

Definition at line 390 of file btGImpactShape.h.

## ◆ getPrimitiveManager()

virtual const btPrimitiveManagerBase * btGImpactCompoundShape::getPrimitiveManager | ( |  | ) | const
| inlinevirtual

Obtains the primitive manager.

Implements btGImpactShapeInterface.

Definition at line 378 of file btGImpactShape.h.

## ◆ needsRetrieveTetrahedrons()

virtual bool btGImpactCompoundShape::needsRetrieveTetrahedrons | ( |  | ) | const
| inlinevirtual

Determines if this shape has tetrahedrons.

Implements btGImpactShapeInterface.

Definition at line 462 of file btGImpactShape.h.

## ◆ needsRetrieveTriangles()

virtual bool btGImpactCompoundShape::needsRetrieveTriangles | ( |  | ) | const
| inlinevirtual

Determines if this shape has triangles.

Implements btGImpactShapeInterface.

Definition at line 456 of file btGImpactShape.h.

## ◆ setChildTransform()

virtual void btGImpactCompoundShape::setChildTransform | ( | int | index,
|  | const btTransform & | transform
| ) |  |
| inlinevirtual

Sets the children transform.

Postcondition
  You must call updateBound() for update the box set.

Implements btGImpactShapeInterface.

Definition at line 448 of file btGImpactShape.h.

## Member Data Documentation

## ◆ m_childShapes

btAlignedObjectArray<btCollisionShape*> btGImpactCompoundShape::m_childShapes
| protected

Definition at line 356 of file btGImpactShape.h.

## ◆ m_childTransforms

btAlignedObjectArray<btTransform> btGImpactCompoundShape::m_childTransforms
| protected

Definition at line 355 of file btGImpactShape.h.

## ◆ m_primitive_manager

CompoundPrimitiveManager btGImpactCompoundShape::m_primitive_manager
| protected

Definition at line 354 of file btGImpactShape.h.

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

- btGImpactShape.h
- btGImpactShape.cpp