com.bulletphysics.extras.gimpact
Class GImpactShapeInterface

java.lang.Object
  extended by com.bulletphysics.collision.shapes.CollisionShape
      extended by com.bulletphysics.collision.shapes.ConcaveShape
          extended by com.bulletphysics.extras.gimpact.GImpactShapeInterface
Direct Known Subclasses:
GImpactMeshShape, GImpactMeshShapePart

public abstract class GImpactShapeInterface
extends ConcaveShape

Base class for gimpact shapes.


Constructor Summary
GImpactShapeInterface()
           
 
Method Summary
 void getAabb(Transform t, Vector3f aabbMin, Vector3f aabbMax)
          If the Bounding box is not updated, then this class attemps to calculate it.
abstract  void getBulletTriangle(int prim_index, TriangleShapeEx triangle)
           
 void getChildAabb(int child_index, Transform t, Vector3f aabbMin, Vector3f aabbMax)
          Retrieves the bound from a child.
abstract  CollisionShape getChildShape(int index)
          Gets the children.
abstract  Transform getChildTransform(int index)
          Gets the children transform.
 com.bulletphysics.extras.gimpact.BoxCollision.AABB getLocalBox(com.bulletphysics.extras.gimpact.BoxCollision.AABB out)
          Obtains the local box, which is the global calculated box of the total of subshapes.
 Vector3f getLocalScaling(Vector3f out)
           
abstract  int getNumChildShapes()
          Gets the number of children.
 BroadphaseNativeType getShapeType()
           
 boolean hasBoxSet()
          Determines if this class has a hierarchy structure for sorting its primitives.
abstract  boolean childrenHasTransform()
          If true, then its children must get transforms.
 void lockChildShapes()
          Call when reading child shapes.
abstract  boolean needsRetrieveTetrahedrons()
          Determines if this shape has tetrahedrons.
abstract  boolean needsRetrieveTriangles()
          Determines if this shape has triangles.
 void postUpdate()
          Tells to this object that is needed to refit the box set.
 void processAllTriangles(TriangleCallback callback, Vector3f aabbMin, Vector3f aabbMax)
          Function for retrieve triangles.
 void rayTest(Vector3f rayFrom, Vector3f rayTo, CollisionWorld.RayResultCallback resultCallback)
          Virtual method for ray collision.
abstract  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()
           
 void updateBound()
          Performs refit operation.
 
Methods inherited from class com.bulletphysics.collision.shapes.ConcaveShape
getMargin
 
Methods inherited from class com.bulletphysics.collision.shapes.CollisionShape
calculateLocalInertia, calculateTemporalAabb, getAngularMotionDisc, getBoundingSphere, getName, 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

GImpactShapeInterface

public GImpactShapeInterface()
Method Detail

updateBound

public void updateBound()
Performs refit operation.

Updates the entire Box set of this shape.

postUpdate() must be called for attemps to calculating the box set, else this function will does nothing.

if m_needs_update == true, then it calls calcLocalAABB();


getAabb

public void getAabb(Transform t,
                    Vector3f aabbMin,
                    Vector3f aabbMax)
If the Bounding box is not updated, then this class attemps to calculate it.

Calls updateBound() for update the box set.

Specified by:
getAabb in class CollisionShape

postUpdate

public void postUpdate()
Tells to this object that is needed to refit the box set.


getLocalBox

public com.bulletphysics.extras.gimpact.BoxCollision.AABB getLocalBox(com.bulletphysics.extras.gimpact.BoxCollision.AABB out)
Obtains the local box, which is the global calculated box of the total of subshapes.


getShapeType

public BroadphaseNativeType getShapeType()
Specified by:
getShapeType in class CollisionShape

setLocalScaling

public void setLocalScaling(Vector3f scaling)
You must call updateBound() for update the box set.

Specified by:
setLocalScaling in class CollisionShape

getLocalScaling

public Vector3f getLocalScaling(Vector3f out)
Specified by:
getLocalScaling in class CollisionShape

setMargin

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

hasBoxSet

public boolean hasBoxSet()
Determines if this class has a hierarchy structure for sorting its primitives.


getNumChildShapes

public abstract int getNumChildShapes()
Gets the number of children.


childrenHasTransform

public abstract boolean childrenHasTransform()
If true, then its children must get transforms.


needsRetrieveTriangles

public abstract boolean needsRetrieveTriangles()
Determines if this shape has triangles.


needsRetrieveTetrahedrons

public abstract boolean needsRetrieveTetrahedrons()
Determines if this shape has tetrahedrons.


getBulletTriangle

public abstract void getBulletTriangle(int prim_index,
                                       TriangleShapeEx triangle)

lockChildShapes

public void lockChildShapes()
Call when reading child shapes.


unlockChildShapes

public void unlockChildShapes()

getChildAabb

public void getChildAabb(int child_index,
                         Transform t,
                         Vector3f aabbMin,
                         Vector3f aabbMax)
Retrieves the bound from a child.


getChildShape

public abstract CollisionShape getChildShape(int index)
Gets the children.


getChildTransform

public abstract Transform getChildTransform(int index)
Gets the children transform.


setChildTransform

public abstract void setChildTransform(int index,
                                       Transform transform)
Sets the children transform.

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


rayTest

public void rayTest(Vector3f rayFrom,
                    Vector3f rayTo,
                    CollisionWorld.RayResultCallback resultCallback)
Virtual method for ray collision.


processAllTriangles

public void processAllTriangles(TriangleCallback callback,
                                Vector3f aabbMin,
                                Vector3f aabbMax)
Function for retrieve triangles. It gives the triangles in local space.

Specified by:
processAllTriangles in class ConcaveShape