Bullet Collision Detection & Physics Library: btGImpactMeshShapePart Class Reference

Bullet Collision Detection & Physics Library

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

This class manages a sub part of a mesh supplied by the btStridingMeshInterface interface. More...

`#include <btGImpactShape.h>`

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

## Classes
class | TrimeshPrimitiveManager
| Trimesh primitive manager. More...

## Public Member Functions
| btGImpactMeshShapePart ()
| btGImpactMeshShapePart (btStridingMeshInterface *meshInterface, int part)
virtual | ~btGImpactMeshShapePart ()
virtual bool | childrenHasTransform () const
| if true, then its children must get transforms. More...
virtual void | lockChildShapes () const
| call when reading child shapes More...
virtual void | unlockChildShapes () const
virtual int | getNumChildShapes () const
| Gets the number of children. More...
virtual btCollisionShape * | getChildShape (int index)
| Gets the children. More...
virtual const btCollisionShape * | getChildShape (int index) const
| Gets the child. More...
virtual btTransform | getChildTransform (int index) const
| Gets the children transform. More...
virtual void | setChildTransform (int index, const btTransform &transform)
| Sets the children transform. More...
virtual const btPrimitiveManagerBase * | getPrimitiveManager () const
| Obtains the primitive manager. More...
TrimeshPrimitiveManager * | getTrimeshPrimitiveManager ()
virtual void | calculateLocalInertia (btScalar mass, btVector3 &inertia) const
virtual const char * | getName () const
virtual eGIMPACT_SHAPE_TYPE | getGImpactShapeType () const
| Subshape member functions. More...
virtual bool | needsRetrieveTriangles () const
| Determines if this shape has triangles. More...
virtual bool | needsRetrieveTetrahedrons () const
| Determines if this shape has tetrahedrons. More...
virtual void | getBulletTriangle (int prim_index, btTriangleShapeEx &triangle) const
virtual void | getBulletTetrahedron (int prim_index, btTetrahedronShapeEx &tetrahedron) const
int | getVertexCount () const
void | getVertex (int vertex_index, btVector3 &vertex) const
void | setMargin (btScalar margin)
btScalar | getMargin () const
virtual void | setLocalScaling (const btVector3 &scaling)
virtual const btVector3 & | getLocalScaling () const
int | getPart () const
virtual void | processAllTriangles (btTriangleCallback *callback, const btVector3 &aabbMin, const btVector3 &aabbMax) const
| Function for retrieve triangles. More...
virtual void | processAllTrianglesRay (btTriangleCallback *callback, const btVector3 &rayFrom, const btVector3 &rayTo) const
| Function for retrieve triangles. More...
Public Member Functions inherited from btGImpactShapeInterface
| btGImpactShapeInterface ()
void | updateBound ()
| performs refit operation More...
void | getAabb (const btTransform &t, btVector3 &aabbMin, btVector3 &aabbMax) const
| If the Bounding box is not updated, then this class attemps to calculate it. More...
virtual void | postUpdate ()
| Tells to this object that is needed to refit the box set. More...
const btAABB & | getLocalBox ()
| Obtains the local box, which is the global calculated box of the total of subshapes. More...
virtual int | getShapeType () const
virtual void | rayTest (const btVector3 &rayFrom, const btVector3 &rayTo, btCollisionWorld::RayResultCallback &resultCallback) const
| virtual method for ray collision More...
const btGImpactBoxSet * | getBoxSet () const
| gets boxset More...
bool | hasBoxSet () const
| Determines if this class has a hierarchy structure for sorting its primitives. More...
void | getPrimitiveTriangle (int index, btPrimitiveTriangle &triangle) const
| if this trimesh More...
virtual void | getChildAabb (int child_index, const btTransform &t, btVector3 &aabbMin, btVector3 &aabbMax) const
| Retrieves the bound from a child. More...
Public Member Functions inherited from btConcaveShape
| BT_DECLARE_ALIGNED_ALLOCATOR ()
| btConcaveShape ()
virtual | ~btConcaveShape ()
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 maximum 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

## Protected Attributes
TrimeshPrimitiveManager | m_primitive_manager
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

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

## Detailed Description

This class manages a sub part of a mesh supplied by the btStridingMeshInterface interface.

- Simply create this shape by passing the btStridingMeshInterface to the constructor btGImpactMeshShapePart, then you must call updateBound() after creating the mesh
- When making operations with this shape, you must call lock before accessing to the trimesh primitives, and then call unlock
- You can handle deformable meshes with this shape, by calling postUpdate() every time when changing the mesh vertices.

Definition at line 531 of file btGImpactShape.h.

## Constructor & Destructor Documentation

## ◆ btGImpactMeshShapePart() [1/2]

btGImpactMeshShapePart::btGImpactMeshShapePart | ( |  | ) |
| inline

Definition at line 720 of file btGImpactShape.h.

## ◆ btGImpactMeshShapePart() [2/2]

btGImpactMeshShapePart::btGImpactMeshShapePart | ( | btStridingMeshInterface * | meshInterface,
|  | int | part
| ) |  |

Definition at line 26 of file btGImpactShape.cpp.

## ◆ ~btGImpactMeshShapePart()

btGImpactMeshShapePart::~btGImpactMeshShapePart | ( |  | ) |
| virtual

Definition at line 48 of file btGImpactShape.cpp.

## Member Function Documentation

## ◆ calculateLocalInertia()

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

Implements btCollisionShape.

Definition at line 126 of file btGImpactShape.cpp.

## ◆ childrenHasTransform()

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

if true, then its children must get transforms.

Implements btGImpactShapeInterface.

Definition at line 729 of file btGImpactShape.h.

## ◆ getBulletTetrahedron()

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

Implements btGImpactShapeInterface.

Definition at line 831 of file btGImpactShape.h.

## ◆ getBulletTriangle()

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

Implements btGImpactShapeInterface.

Definition at line 826 of file btGImpactShape.h.

## ◆ getChildShape() [1/2]

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

Gets the children.

Implements btGImpactShapeInterface.

Definition at line 747 of file btGImpactShape.h.

## ◆ getChildShape() [2/2]

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

Gets the child.

Implements btGImpactShapeInterface.

Definition at line 757 of file btGImpactShape.h.

## ◆ getChildTransform()

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

Gets the children transform.

Implements btGImpactShapeInterface.

Definition at line 765 of file btGImpactShape.h.

## ◆ getGImpactShapeType()

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

Subshape member functions.

Base method for determinig which kind of GIMPACT shape we get

Implements btGImpactShapeInterface.

Definition at line 809 of file btGImpactShape.h.

## ◆ getLocalScaling()

virtual const btVector3& btGImpactMeshShapePart::getLocalScaling | ( |  | ) | const
| inlinevirtual

Reimplemented from btGImpactShapeInterface.

Definition at line 867 of file btGImpactShape.h.

## ◆ getMargin()

btScalar btGImpactMeshShapePart::getMargin | ( |  | ) | const
| inlinevirtual

Reimplemented from btConcaveShape.

Definition at line 856 of file btGImpactShape.h.

## ◆ getName()

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

Implements btCollisionShape.

Definition at line 804 of file btGImpactShape.h.

## ◆ getNumChildShapes()

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

Gets the number of children.

Implements btGImpactShapeInterface.

Definition at line 740 of file btGImpactShape.h.

## ◆ getPart()

int btGImpactMeshShapePart::getPart | ( |  | ) | const
| inline

Definition at line 872 of file btGImpactShape.h.

## ◆ getPrimitiveManager()

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

Obtains the primitive manager.

Implements btGImpactShapeInterface.

Definition at line 785 of file btGImpactShape.h.

## ◆ getTrimeshPrimitiveManager()

TrimeshPrimitiveManager* btGImpactMeshShapePart::getTrimeshPrimitiveManager | ( |  | ) |
| inline

Definition at line 790 of file btGImpactShape.h.

## ◆ getVertex()

void btGImpactMeshShapePart::getVertex | ( | int | vertex_index,
|  | btVector3 & | vertex
| ) |  | const
| inline

Definition at line 845 of file btGImpactShape.h.

## ◆ getVertexCount()

int btGImpactMeshShapePart::getVertexCount | ( |  | ) | const
| inline

Definition at line 840 of file btGImpactShape.h.

## ◆ lockChildShapes()

void btGImpactMeshShapePart::lockChildShapes | ( |  | ) | const
| virtual

call when reading child shapes

Reimplemented from btGImpactShapeInterface.

Definition at line 56 of file btGImpactShape.cpp.

## ◆ needsRetrieveTetrahedrons()

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

Determines if this shape has tetrahedrons.

Implements btGImpactShapeInterface.

Definition at line 821 of file btGImpactShape.h.

## ◆ needsRetrieveTriangles()

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

Determines if this shape has triangles.

Implements btGImpactShapeInterface.

Definition at line 815 of file btGImpactShape.h.

## ◆ processAllTriangles()

void btGImpactMeshShapePart::processAllTriangles | ( | btTriangleCallback * | callback,
|  | const btVector3 & | aabbMin,
|  | const btVector3 & | aabbMax
| ) |  | const
| virtual

Function for retrieve triangles.

It gives the triangles in local space

Reimplemented from btGImpactShapeInterface.

Definition at line 227 of file btGImpactShape.cpp.

## ◆ processAllTrianglesRay()

void btGImpactMeshShapePart::processAllTrianglesRay | ( | btTriangleCallback * | ,
|  | const btVector3 & | ,
|  | const btVector3 & |
| ) |  | const
| virtual

Function for retrieve triangles.

It gives the triangles in local space

Reimplemented from btGImpactShapeInterface.

Definition at line 201 of file btGImpactShape.cpp.

## ◆ setChildTransform()

virtual void btGImpactMeshShapePart::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 776 of file btGImpactShape.h.

## ◆ setLocalScaling()

virtual void btGImpactMeshShapePart::setLocalScaling | ( | const btVector3 & | scaling | ) |
| inlinevirtual

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

Reimplemented from btGImpactShapeInterface.

Definition at line 861 of file btGImpactShape.h.

## ◆ setMargin()

void btGImpactMeshShapePart::setMargin | ( | btScalar | margin | ) |
| inlinevirtual

Reimplemented from btGImpactShapeInterface.

Definition at line 850 of file btGImpactShape.h.

## ◆ unlockChildShapes()

void btGImpactMeshShapePart::unlockChildShapes | ( |  | ) | const
| virtual

Reimplemented from btGImpactShapeInterface.

Definition at line 67 of file btGImpactShape.cpp.

## Member Data Documentation

## ◆ m_primitive_manager

TrimeshPrimitiveManager btGImpactMeshShapePart::m_primitive_manager
| protected

Definition at line 717 of file btGImpactShape.h.

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

- btGImpactShape.h
- btGImpactShape.cpp