com.bulletphysics.collision.shapes
Class TriangleShape

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.TriangleShape

public class TriangleShape
extends PolyhedralConvexShape


Field Summary
 javax.vecmath.Vector3f[] vertices1
           
 
Fields inherited from class com.bulletphysics.collision.shapes.PolyhedralConvexShape
isLocalAabbValid, localAabbMax, localAabbMin
 
Fields inherited from class com.bulletphysics.collision.shapes.ConvexInternalShape
collisionMargin, implicitShapeDimensions, localScaling
 
Fields inherited from class com.bulletphysics.collision.shapes.ConvexShape
MAX_PREFERRED_PENETRATION_DIRECTIONS
 
Constructor Summary
TriangleShape()
           
TriangleShape(javax.vecmath.Vector3f p0, javax.vecmath.Vector3f p1, javax.vecmath.Vector3f p2)
           
 
Method Summary
 void batchedUnitVectorGetSupportingVertexWithoutMargin(javax.vecmath.Vector3f[] vectors, javax.vecmath.Vector3f[] supportVerticesOut, int numVectors)
           
 void calcNormal(javax.vecmath.Vector3f normal)
           
 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)
           
 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(int i, javax.vecmath.Vector3f planeNormal, javax.vecmath.Vector3f planeSupport)
           
 void getPreferredPenetrationDirection(int index, javax.vecmath.Vector3f penetrationVector)
           
 BroadphaseNativeType getShapeType()
           
 void getVertex(int index, javax.vecmath.Vector3f vert)
           
 javax.vecmath.Vector3f getVertexPtr(int index)
           
 void init(javax.vecmath.Vector3f p0, javax.vecmath.Vector3f p1, javax.vecmath.Vector3f p2)
           
 boolean isInside(javax.vecmath.Vector3f pt, float tolerance)
           
 javax.vecmath.Vector3f localGetSupportingVertexWithoutMargin(javax.vecmath.Vector3f dir, javax.vecmath.Vector3f out)
           
 
Methods inherited from class com.bulletphysics.collision.shapes.PolyhedralConvexShape
_PolyhedralConvexShape_getAabb, recalcLocalAabb
 
Methods inherited from class com.bulletphysics.collision.shapes.ConvexInternalShape
getAabbSlow, getLocalScaling, getMargin, localGetSupportingVertex, setLocalScaling, setMargin
 
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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

vertices1

public final javax.vecmath.Vector3f[] vertices1
Constructor Detail

TriangleShape

public TriangleShape()

TriangleShape

public TriangleShape(javax.vecmath.Vector3f p0,
                     javax.vecmath.Vector3f p1,
                     javax.vecmath.Vector3f p2)
Method Detail

init

public void init(javax.vecmath.Vector3f p0,
                 javax.vecmath.Vector3f p1,
                 javax.vecmath.Vector3f p2)

getNumVertices

public int getNumVertices()
Specified by:
getNumVertices in class PolyhedralConvexShape

getVertexPtr

public javax.vecmath.Vector3f getVertexPtr(int index)

getVertex

public void getVertex(int index,
                      javax.vecmath.Vector3f vert)
Specified by:
getVertex in class PolyhedralConvexShape

getShapeType

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

getNumEdges

public int getNumEdges()
Specified by:
getNumEdges in class PolyhedralConvexShape

getEdge

public void getEdge(int i,
                    javax.vecmath.Vector3f pa,
                    javax.vecmath.Vector3f pb)
Specified by:
getEdge in class PolyhedralConvexShape

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

localGetSupportingVertexWithoutMargin

public javax.vecmath.Vector3f localGetSupportingVertexWithoutMargin(javax.vecmath.Vector3f dir,
                                                                    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

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

calcNormal

public void calcNormal(javax.vecmath.Vector3f normal)

getPlaneEquation

public void getPlaneEquation(int i,
                             javax.vecmath.Vector3f planeNormal,
                             javax.vecmath.Vector3f planeSupport)

calculateLocalInertia

public void calculateLocalInertia(float mass,
                                  javax.vecmath.Vector3f inertia)
Overrides:
calculateLocalInertia 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