com.bulletphysics.collision.shapes
Class BoxShape
java.lang.Object
com.bulletphysics.collision.shapes.CollisionShape
com.bulletphysics.collision.shapes.ConvexShape
com.bulletphysics.collision.shapes.ConvexInternalShape
com.bulletphysics.collision.shapes.PolyhedralConvexShape
com.bulletphysics.collision.shapes.BoxShape
- Direct Known Subclasses:
- CylinderShape
public class BoxShape
- extends PolyhedralConvexShape
BoxShape implements both a feature based (vertex/edge/plane) and implicit (getSupportingVertex) Box.
Constructor Summary |
BoxShape(javax.vecmath.Vector3f boxHalfExtents)
|
Method Summary |
void |
batchedUnitVectorGetSupportingVertexWithoutMargin(javax.vecmath.Vector3f[] vectors,
javax.vecmath.Vector3f[] supportVerticesOut,
int numVectors)
|
void |
calculateLocalInertia(float mass,
javax.vecmath.Vector3f inertia)
|
void |
getAabb(Transform t,
javax.vecmath.Vector3f aabbMin,
javax.vecmath.Vector3f aabbMax)
getAabb's default implementation is brute force, expected derived classes to implement a fast dedicated version. |
void |
getEdge(int i,
javax.vecmath.Vector3f pa,
javax.vecmath.Vector3f pb)
|
javax.vecmath.Vector3f |
getHalfExtentsWithMargin(javax.vecmath.Vector3f out)
|
javax.vecmath.Vector3f |
getHalfExtentsWithoutMargin(javax.vecmath.Vector3f out)
|
java.lang.String |
getName()
|
int |
getNumEdges()
|
int |
getNumPlanes()
|
int |
getNumPreferredPenetrationDirections()
|
int |
getNumVertices()
|
void |
getPlane(javax.vecmath.Vector3f planeNormal,
javax.vecmath.Vector3f planeSupport,
int i)
|
void |
getPlaneEquation(javax.vecmath.Vector4f plane,
int i)
|
void |
getPreferredPenetrationDirection(int index,
javax.vecmath.Vector3f penetrationVector)
|
BroadphaseNativeType |
getShapeType()
|
void |
getVertex(int i,
javax.vecmath.Vector3f vtx)
|
boolean |
isInside(javax.vecmath.Vector3f pt,
float tolerance)
|
javax.vecmath.Vector3f |
localGetSupportingVertex(javax.vecmath.Vector3f vec,
javax.vecmath.Vector3f out)
|
javax.vecmath.Vector3f |
localGetSupportingVertexWithoutMargin(javax.vecmath.Vector3f vec,
javax.vecmath.Vector3f out)
|
void |
setLocalScaling(javax.vecmath.Vector3f scaling)
|
void |
setMargin(float margin)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BoxShape
public BoxShape(javax.vecmath.Vector3f boxHalfExtents)
getHalfExtentsWithMargin
public javax.vecmath.Vector3f getHalfExtentsWithMargin(javax.vecmath.Vector3f out)
getHalfExtentsWithoutMargin
public javax.vecmath.Vector3f getHalfExtentsWithoutMargin(javax.vecmath.Vector3f out)
getShapeType
public BroadphaseNativeType getShapeType()
- Specified by:
getShapeType
in class CollisionShape
localGetSupportingVertex
public javax.vecmath.Vector3f localGetSupportingVertex(javax.vecmath.Vector3f vec,
javax.vecmath.Vector3f out)
- Overrides:
localGetSupportingVertex
in class ConvexInternalShape
localGetSupportingVertexWithoutMargin
public javax.vecmath.Vector3f localGetSupportingVertexWithoutMargin(javax.vecmath.Vector3f vec,
javax.vecmath.Vector3f out)
- Overrides:
localGetSupportingVertexWithoutMargin
in class PolyhedralConvexShape
batchedUnitVectorGetSupportingVertexWithoutMargin
public void batchedUnitVectorGetSupportingVertexWithoutMargin(javax.vecmath.Vector3f[] vectors,
javax.vecmath.Vector3f[] supportVerticesOut,
int numVectors)
- Overrides:
batchedUnitVectorGetSupportingVertexWithoutMargin
in class PolyhedralConvexShape
setMargin
public void setMargin(float margin)
- Overrides:
setMargin
in class ConvexInternalShape
setLocalScaling
public void setLocalScaling(javax.vecmath.Vector3f scaling)
- Overrides:
setLocalScaling
in class ConvexInternalShape
getAabb
public void getAabb(Transform t,
javax.vecmath.Vector3f aabbMin,
javax.vecmath.Vector3f aabbMax)
- Description copied from class:
ConvexInternalShape
- getAabb's default implementation is brute force, expected derived classes to implement a fast dedicated version.
- Overrides:
getAabb
in class PolyhedralConvexShape
calculateLocalInertia
public void calculateLocalInertia(float mass,
javax.vecmath.Vector3f inertia)
- Overrides:
calculateLocalInertia
in class PolyhedralConvexShape
getPlane
public void getPlane(javax.vecmath.Vector3f planeNormal,
javax.vecmath.Vector3f planeSupport,
int i)
- Specified by:
getPlane
in class PolyhedralConvexShape
getNumPlanes
public int getNumPlanes()
- Specified by:
getNumPlanes
in class PolyhedralConvexShape
getNumVertices
public int getNumVertices()
- Specified by:
getNumVertices
in class PolyhedralConvexShape
getNumEdges
public int getNumEdges()
- Specified by:
getNumEdges
in class PolyhedralConvexShape
getVertex
public void getVertex(int i,
javax.vecmath.Vector3f vtx)
- Specified by:
getVertex
in class PolyhedralConvexShape
getPlaneEquation
public void getPlaneEquation(javax.vecmath.Vector4f plane,
int i)
getEdge
public void getEdge(int i,
javax.vecmath.Vector3f pa,
javax.vecmath.Vector3f pb)
- Specified by:
getEdge
in class PolyhedralConvexShape
isInside
public boolean isInside(javax.vecmath.Vector3f pt,
float tolerance)
- Specified by:
isInside
in class PolyhedralConvexShape
getName
public java.lang.String getName()
- Specified by:
getName
in class CollisionShape
getNumPreferredPenetrationDirections
public int getNumPreferredPenetrationDirections()
- Overrides:
getNumPreferredPenetrationDirections
in class ConvexInternalShape
getPreferredPenetrationDirection
public void getPreferredPenetrationDirection(int index,
javax.vecmath.Vector3f penetrationVector)
- Overrides:
getPreferredPenetrationDirection
in class ConvexInternalShape