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 is a box primitive around the origin, its sides axis aligned with length
specified by half extents, in local shape coordinates. When used as part of a
CollisionObject
or RigidBody
it will be an oriented box in world space.
Method Summary |
void |
batchedUnitVectorGetSupportingVertexWithoutMargin(Vector3f[] vectors,
Vector3f[] supportVerticesOut,
int numVectors)
|
void |
calculateLocalInertia(float mass,
Vector3f inertia)
|
void |
getAabb(Transform t,
Vector3f aabbMin,
Vector3f aabbMax)
getAabb's default implementation is brute force, expected derived classes to implement a fast dedicated version. |
void |
getEdge(int i,
Vector3f pa,
Vector3f pb)
|
Vector3f |
getHalfExtentsWithMargin(Vector3f out)
|
Vector3f |
getHalfExtentsWithoutMargin(Vector3f out)
|
String |
getName()
|
int |
getNumEdges()
|
int |
getNumPlanes()
|
int |
getNumPreferredPenetrationDirections()
|
int |
getNumVertices()
|
void |
getPlane(Vector3f planeNormal,
Vector3f planeSupport,
int i)
|
void |
getPlaneEquation(Vector4f plane,
int i)
|
void |
getPreferredPenetrationDirection(int index,
Vector3f penetrationVector)
|
BroadphaseNativeType |
getShapeType()
|
void |
getVertex(int i,
Vector3f vtx)
|
boolean |
isInside(Vector3f pt,
float tolerance)
|
Vector3f |
localGetSupportingVertex(Vector3f vec,
Vector3f out)
|
Vector3f |
localGetSupportingVertexWithoutMargin(Vector3f vec,
Vector3f out)
|
void |
setLocalScaling(Vector3f scaling)
|
void |
setMargin(float margin)
|
BoxShape
public BoxShape(Vector3f boxHalfExtents)
getHalfExtentsWithMargin
public Vector3f getHalfExtentsWithMargin(Vector3f out)
getHalfExtentsWithoutMargin
public Vector3f getHalfExtentsWithoutMargin(Vector3f out)
getShapeType
public BroadphaseNativeType getShapeType()
- Specified by:
getShapeType
in class CollisionShape
localGetSupportingVertex
public Vector3f localGetSupportingVertex(Vector3f vec,
Vector3f out)
- Overrides:
localGetSupportingVertex
in class ConvexInternalShape
localGetSupportingVertexWithoutMargin
public Vector3f localGetSupportingVertexWithoutMargin(Vector3f vec,
Vector3f out)
- Overrides:
localGetSupportingVertexWithoutMargin
in class PolyhedralConvexShape
batchedUnitVectorGetSupportingVertexWithoutMargin
public void batchedUnitVectorGetSupportingVertexWithoutMargin(Vector3f[] vectors,
Vector3f[] supportVerticesOut,
int numVectors)
- Overrides:
batchedUnitVectorGetSupportingVertexWithoutMargin
in class PolyhedralConvexShape
setMargin
public void setMargin(float margin)
- Overrides:
setMargin
in class ConvexInternalShape
setLocalScaling
public void setLocalScaling(Vector3f scaling)
- Overrides:
setLocalScaling
in class PolyhedralConvexShape
getAabb
public void getAabb(Transform t,
Vector3f aabbMin,
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,
Vector3f inertia)
- Overrides:
calculateLocalInertia
in class PolyhedralConvexShape
getPlane
public void getPlane(Vector3f planeNormal,
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,
Vector3f vtx)
- Specified by:
getVertex
in class PolyhedralConvexShape
getPlaneEquation
public void getPlaneEquation(Vector4f plane,
int i)
getEdge
public void getEdge(int i,
Vector3f pa,
Vector3f pb)
- Specified by:
getEdge
in class PolyhedralConvexShape
isInside
public boolean isInside(Vector3f pt,
float tolerance)
- Specified by:
isInside
in class PolyhedralConvexShape
getName
public String getName()
- Specified by:
getName
in class CollisionShape
getNumPreferredPenetrationDirections
public int getNumPreferredPenetrationDirections()
- Overrides:
getNumPreferredPenetrationDirections
in class ConvexInternalShape
getPreferredPenetrationDirection
public void getPreferredPenetrationDirection(int index,
Vector3f penetrationVector)
- Overrides:
getPreferredPenetrationDirection
in class ConvexInternalShape