com.bulletphysics.collision.shapes
Class BoxShape

java.lang.Object
  extended by com.bulletphysics.collision.shapes.CollisionShape
      extended by com.bulletphysics.collision.shapes.ConvexShape
          extended by com.bulletphysics.collision.shapes.ConvexInternalShape
              extended by com.bulletphysics.collision.shapes.PolyhedralConvexShape
                  extended by 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.


Field Summary
 
Fields inherited from class com.bulletphysics.collision.shapes.ConvexShape
MAX_PREFERRED_PENETRATION_DIRECTIONS
 
Constructor Summary
BoxShape(Vector3f boxHalfExtents)
           
 
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)
           
 
Methods inherited from class com.bulletphysics.collision.shapes.PolyhedralConvexShape
recalcLocalAabb
 
Methods inherited from class com.bulletphysics.collision.shapes.ConvexInternalShape
getAabbSlow, getLocalScaling, getMargin
 
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

BoxShape

public BoxShape(Vector3f boxHalfExtents)
Method Detail

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