com.bulletphysics.extras.gimpact
Class GImpactMeshShapePart

java.lang.Object
  extended by com.bulletphysics.collision.shapes.CollisionShape
      extended by com.bulletphysics.collision.shapes.ConcaveShape
          extended by com.bulletphysics.extras.gimpact.GImpactShapeInterface
              extended by com.bulletphysics.extras.gimpact.GImpactMeshShapePart

public class GImpactMeshShapePart
extends GImpactShapeInterface

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

- Simply create this shape by passing the StridingMeshInterface to the constructor GImpactMeshShapePart, 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.


Constructor Summary
GImpactMeshShapePart()
           
GImpactMeshShapePart(StridingMeshInterface meshInterface, int part)
           
 
Method Summary
 void calculateLocalInertia(float mass, Vector3f inertia)
           
 void getBulletTriangle(int prim_index, TriangleShapeEx triangle)
           
 CollisionShape getChildShape(int index)
          Gets the children.
 Transform getChildTransform(int index)
          Gets the children transform.
 Vector3f getLocalScaling(Vector3f out)
           
 float getMargin()
           
 String getName()
           
 int getNumChildShapes()
          Gets the number of children.
 int getPart()
           
 void getVertex(int vertex_index, Vector3f vertex)
           
 int getVertexCount()
           
 boolean childrenHasTransform()
          If true, then its children must get transforms.
 void lockChildShapes()
          Call when reading child shapes.
 boolean needsRetrieveTetrahedrons()
          Determines if this shape has tetrahedrons.
 boolean needsRetrieveTriangles()
          Determines if this shape has triangles.
 void processAllTriangles(TriangleCallback callback, Vector3f aabbMin, Vector3f aabbMax)
          Function for retrieve triangles.
 void setChildTransform(int index, Transform transform)
          Sets the children transform.
 void setLocalScaling(Vector3f scaling)
          You must call updateBound() for update the box set.
 void setMargin(float margin)
           
 void unlockChildShapes()
           
 
Methods inherited from class com.bulletphysics.extras.gimpact.GImpactShapeInterface
getAabb, getChildAabb, getLocalBox, getShapeType, hasBoxSet, postUpdate, rayTest, updateBound
 
Methods inherited from class com.bulletphysics.collision.shapes.CollisionShape
calculateTemporalAabb, getAngularMotionDisc, getBoundingSphere, getUserPointer, isCompound, isConcave, isConvex, isInfinite, isPolyhedral, setUserPointer
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GImpactMeshShapePart

public GImpactMeshShapePart()

GImpactMeshShapePart

public GImpactMeshShapePart(StridingMeshInterface meshInterface,
                            int part)
Method Detail

childrenHasTransform

public boolean childrenHasTransform()
Description copied from class: GImpactShapeInterface
If true, then its children must get transforms.

Specified by:
childrenHasTransform in class GImpactShapeInterface

lockChildShapes

public void lockChildShapes()
Description copied from class: GImpactShapeInterface
Call when reading child shapes.

Overrides:
lockChildShapes in class GImpactShapeInterface

unlockChildShapes

public void unlockChildShapes()
Overrides:
unlockChildShapes in class GImpactShapeInterface

getNumChildShapes

public int getNumChildShapes()
Description copied from class: GImpactShapeInterface
Gets the number of children.

Specified by:
getNumChildShapes in class GImpactShapeInterface

getChildShape

public CollisionShape getChildShape(int index)
Description copied from class: GImpactShapeInterface
Gets the children.

Specified by:
getChildShape in class GImpactShapeInterface

getChildTransform

public Transform getChildTransform(int index)
Description copied from class: GImpactShapeInterface
Gets the children transform.

Specified by:
getChildTransform in class GImpactShapeInterface

setChildTransform

public void setChildTransform(int index,
                              Transform transform)
Description copied from class: GImpactShapeInterface
Sets the children transform.

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

Specified by:
setChildTransform in class GImpactShapeInterface

calculateLocalInertia

public void calculateLocalInertia(float mass,
                                  Vector3f inertia)
Specified by:
calculateLocalInertia in class CollisionShape

getName

public String getName()
Specified by:
getName in class CollisionShape

needsRetrieveTriangles

public boolean needsRetrieveTriangles()
Description copied from class: GImpactShapeInterface
Determines if this shape has triangles.

Specified by:
needsRetrieveTriangles in class GImpactShapeInterface

needsRetrieveTetrahedrons

public boolean needsRetrieveTetrahedrons()
Description copied from class: GImpactShapeInterface
Determines if this shape has tetrahedrons.

Specified by:
needsRetrieveTetrahedrons in class GImpactShapeInterface

getBulletTriangle

public void getBulletTriangle(int prim_index,
                              TriangleShapeEx triangle)
Specified by:
getBulletTriangle in class GImpactShapeInterface

getVertexCount

public int getVertexCount()

getVertex

public void getVertex(int vertex_index,
                      Vector3f vertex)

setMargin

public void setMargin(float margin)
Overrides:
setMargin in class GImpactShapeInterface

getMargin

public float getMargin()
Overrides:
getMargin in class ConcaveShape

setLocalScaling

public void setLocalScaling(Vector3f scaling)
Description copied from class: GImpactShapeInterface
You must call updateBound() for update the box set.

Overrides:
setLocalScaling in class GImpactShapeInterface

getLocalScaling

public Vector3f getLocalScaling(Vector3f out)
Overrides:
getLocalScaling in class GImpactShapeInterface

getPart

public int getPart()

processAllTriangles

public void processAllTriangles(TriangleCallback callback,
                                Vector3f aabbMin,
                                Vector3f aabbMax)
Description copied from class: GImpactShapeInterface
Function for retrieve triangles. It gives the triangles in local space.

Overrides:
processAllTriangles in class GImpactShapeInterface