com.bulletphysics.collision.shapes
Class CompoundShape
java.lang.Object
com.bulletphysics.collision.shapes.CollisionShape
com.bulletphysics.collision.shapes.CompoundShape
public class CompoundShape
- extends CollisionShape
CompoundShape allows to store multiple other CollisionShapes.
This allows for concave collision objects. This is more general then the Static Concave TriangleMeshShape.
CompoundShape
public CompoundShape()
addChildShape
public void addChildShape(Transform localTransform,
CollisionShape shape)
removeChildShape
public void removeChildShape(CollisionShape shape)
- Remove all children shapes that contain the specified shape.
getNumChildShapes
public int getNumChildShapes()
getChildShape
public CollisionShape getChildShape(int index)
getChildTransform
public Transform getChildTransform(int index,
Transform out)
getChildList
public List<CompoundShapeChild> getChildList()
getAabb
public void getAabb(Transform trans,
Vector3f aabbMin,
Vector3f aabbMax)
- getAabb's default implementation is brute force, expected derived classes to implement a fast dedicated version.
- Specified by:
getAabb
in class CollisionShape
recalculateLocalAabb
public void recalculateLocalAabb()
- Re-calculate the local Aabb. Is called at the end of removeChildShapes.
Use this yourself if you modify the children or their transforms.
setLocalScaling
public void setLocalScaling(Vector3f scaling)
- Specified by:
setLocalScaling
in class CollisionShape
getLocalScaling
public Vector3f getLocalScaling(Vector3f out)
- Specified by:
getLocalScaling
in class CollisionShape
calculateLocalInertia
public void calculateLocalInertia(float mass,
Vector3f inertia)
- Specified by:
calculateLocalInertia
in class CollisionShape
getShapeType
public BroadphaseNativeType getShapeType()
- Specified by:
getShapeType
in class CollisionShape
setMargin
public void setMargin(float margin)
- Specified by:
setMargin
in class CollisionShape
getMargin
public float getMargin()
- Specified by:
getMargin
in class CollisionShape
getName
public String getName()
- Specified by:
getName
in class CollisionShape
getAabbTree
public OptimizedBvh getAabbTree()