|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.bulletphysics.collision.shapes.CollisionShape com.bulletphysics.collision.shapes.ConcaveShape com.bulletphysics.collision.shapes.TriangleMeshShape com.bulletphysics.collision.shapes.BvhTriangleMeshShape
public class BvhTriangleMeshShape
BvhTriangleMeshShape is a static-triangle mesh shape with several optimizations, such as bounding volume hierarchy. It is recommended to enable useQuantizedAabbCompression for better memory usage.
It takes a triangle mesh as input, for example a TriangleMesh
or
TriangleIndexVertexArray
. The BvhTriangleMeshShape class allows for
triangle mesh deformations by a refit or partialRefit method.
Instead of building the bounding volume hierarchy acceleration structure, it is also possible to serialize (save) and deserialize (load) the structure from disk. See ConcaveDemo for an example.
Constructor Summary | |
---|---|
BvhTriangleMeshShape()
|
|
BvhTriangleMeshShape(StridingMeshInterface meshInterface,
boolean useQuantizedAabbCompression)
|
|
BvhTriangleMeshShape(StridingMeshInterface meshInterface,
boolean useQuantizedAabbCompression,
boolean buildBvh)
|
|
BvhTriangleMeshShape(StridingMeshInterface meshInterface,
boolean useQuantizedAabbCompression,
Vector3f bvhAabbMin,
Vector3f bvhAabbMax)
Optionally pass in a larger bvh aabb, used for quantization. |
|
BvhTriangleMeshShape(StridingMeshInterface meshInterface,
boolean useQuantizedAabbCompression,
Vector3f bvhAabbMin,
Vector3f bvhAabbMax,
boolean buildBvh)
Optionally pass in a larger bvh aabb, used for quantization. |
Method Summary | |
---|---|
String |
getName()
|
OptimizedBvh |
getOptimizedBvh()
|
boolean |
getOwnsBvh()
|
BroadphaseNativeType |
getShapeType()
|
void |
partialRefitTree(Vector3f aabbMin,
Vector3f aabbMax)
For a fast incremental refit of parts of the tree. |
void |
performConvexcast(TriangleCallback callback,
Vector3f raySource,
Vector3f rayTarget,
Vector3f aabbMin,
Vector3f aabbMax)
|
void |
performRaycast(TriangleCallback callback,
Vector3f raySource,
Vector3f rayTarget)
|
void |
processAllTriangles(TriangleCallback callback,
Vector3f aabbMin,
Vector3f aabbMax)
Perform bvh tree traversal and report overlapping triangles to 'callback'. |
void |
refitTree(Vector3f aabbMin,
Vector3f aabbMax)
|
void |
setLocalScaling(Vector3f scaling)
|
void |
setOptimizedBvh(OptimizedBvh bvh)
|
void |
setOptimizedBvh(OptimizedBvh bvh,
Vector3f scaling)
|
boolean |
usesQuantizedAabbCompression()
|
Methods inherited from class com.bulletphysics.collision.shapes.TriangleMeshShape |
---|
calculateLocalInertia, getAabb, getLocalAabbMax, getLocalAabbMin, getLocalScaling, getMeshInterface, localGetSupportingVertex, localGetSupportingVertexWithoutMargin, recalcLocalAabb |
Methods inherited from class com.bulletphysics.collision.shapes.ConcaveShape |
---|
getMargin, 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 |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BvhTriangleMeshShape()
public BvhTriangleMeshShape(StridingMeshInterface meshInterface, boolean useQuantizedAabbCompression)
public BvhTriangleMeshShape(StridingMeshInterface meshInterface, boolean useQuantizedAabbCompression, boolean buildBvh)
public BvhTriangleMeshShape(StridingMeshInterface meshInterface, boolean useQuantizedAabbCompression, Vector3f bvhAabbMin, Vector3f bvhAabbMax)
public BvhTriangleMeshShape(StridingMeshInterface meshInterface, boolean useQuantizedAabbCompression, Vector3f bvhAabbMin, Vector3f bvhAabbMax, boolean buildBvh)
Method Detail |
---|
public boolean getOwnsBvh()
public BroadphaseNativeType getShapeType()
getShapeType
in class CollisionShape
public void performRaycast(TriangleCallback callback, Vector3f raySource, Vector3f rayTarget)
public void performConvexcast(TriangleCallback callback, Vector3f raySource, Vector3f rayTarget, Vector3f aabbMin, Vector3f aabbMax)
public void processAllTriangles(TriangleCallback callback, Vector3f aabbMin, Vector3f aabbMax)
processAllTriangles
in class TriangleMeshShape
public void refitTree(Vector3f aabbMin, Vector3f aabbMax)
public void partialRefitTree(Vector3f aabbMin, Vector3f aabbMax)
public String getName()
getName
in class TriangleMeshShape
public void setLocalScaling(Vector3f scaling)
setLocalScaling
in class TriangleMeshShape
public OptimizedBvh getOptimizedBvh()
public void setOptimizedBvh(OptimizedBvh bvh)
public void setOptimizedBvh(OptimizedBvh bvh, Vector3f scaling)
public boolean usesQuantizedAabbCompression()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |