com.bulletphysics.collision.dispatch
Class CollisionWorld

java.lang.Object
  extended by com.bulletphysics.collision.dispatch.CollisionWorld
Direct Known Subclasses:
DynamicsWorld

public class CollisionWorld
extends Object

CollisionWorld is interface and container for the collision detection.


Nested Class Summary
static class CollisionWorld.ClosestConvexResultCallback
           
static class CollisionWorld.ClosestRayResultCallback
           
static class CollisionWorld.ConvexResultCallback
           
static class CollisionWorld.LocalConvexResult
           
static class CollisionWorld.LocalRayResult
           
static class CollisionWorld.LocalShapeInfo
          LocalShapeInfo gives extra information for complex shapes.
static class CollisionWorld.RayResultCallback
          RayResultCallback is used to report new raycast results.
 
Constructor Summary
CollisionWorld(Dispatcher dispatcher, BroadphaseInterface broadphasePairCache, CollisionConfiguration collisionConfiguration)
          This constructor doesn't own the dispatcher and paircache/broadphase.
 
Method Summary
 void addCollisionObject(CollisionObject collisionObject)
           
 void addCollisionObject(CollisionObject collisionObject, short collisionFilterGroup, short collisionFilterMask)
           
 void convexSweepTest(ConvexShape castShape, Transform convexFromWorld, Transform convexToWorld, CollisionWorld.ConvexResultCallback resultCallback)
          convexTest performs a swept convex cast on all objects in the CollisionWorld, and calls the resultCallback This allows for several queries: first hit, all hits, any hit, dependent on the value return by the callback.
 void destroy()
           
 BroadphaseInterface getBroadphase()
           
 ObjectArrayList<CollisionObject> getCollisionObjectArray()
           
 IDebugDraw getDebugDrawer()
           
 Dispatcher getDispatcher()
           
 DispatcherInfo getDispatchInfo()
           
 int getNumCollisionObjects()
           
 OverlappingPairCache getPairCache()
           
static void objectQuerySingle(ConvexShape castShape, Transform convexFromTrans, Transform convexToTrans, CollisionObject collisionObject, CollisionShape collisionShape, Transform colObjWorldTransform, CollisionWorld.ConvexResultCallback resultCallback, float allowedPenetration)
          objectQuerySingle performs a collision detection query and calls the resultCallback.
 void performDiscreteCollisionDetection()
           
 void rayTest(Vector3f rayFromWorld, Vector3f rayToWorld, CollisionWorld.RayResultCallback resultCallback)
          rayTest performs a raycast on all objects in the CollisionWorld, and calls the resultCallback.
static void rayTestSingle(Transform rayFromTrans, Transform rayToTrans, CollisionObject collisionObject, CollisionShape collisionShape, Transform colObjWorldTransform, CollisionWorld.RayResultCallback resultCallback)
           
 void removeCollisionObject(CollisionObject collisionObject)
           
 void setBroadphase(BroadphaseInterface pairCache)
           
 void setDebugDrawer(IDebugDraw debugDrawer)
           
 void updateAabbs()
           
 void updateSingleAabb(CollisionObject colObj)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CollisionWorld

public CollisionWorld(Dispatcher dispatcher,
                      BroadphaseInterface broadphasePairCache,
                      CollisionConfiguration collisionConfiguration)
This constructor doesn't own the dispatcher and paircache/broadphase.

Method Detail

destroy

public void destroy()

addCollisionObject

public void addCollisionObject(CollisionObject collisionObject)

addCollisionObject

public void addCollisionObject(CollisionObject collisionObject,
                               short collisionFilterGroup,
                               short collisionFilterMask)

performDiscreteCollisionDetection

public void performDiscreteCollisionDetection()

removeCollisionObject

public void removeCollisionObject(CollisionObject collisionObject)

setBroadphase

public void setBroadphase(BroadphaseInterface pairCache)

getBroadphase

public BroadphaseInterface getBroadphase()

getPairCache

public OverlappingPairCache getPairCache()

getDispatcher

public Dispatcher getDispatcher()

getDispatchInfo

public DispatcherInfo getDispatchInfo()

updateSingleAabb

public void updateSingleAabb(CollisionObject colObj)

updateAabbs

public void updateAabbs()

getDebugDrawer

public IDebugDraw getDebugDrawer()

setDebugDrawer

public void setDebugDrawer(IDebugDraw debugDrawer)

getNumCollisionObjects

public int getNumCollisionObjects()

rayTestSingle

public static void rayTestSingle(Transform rayFromTrans,
                                 Transform rayToTrans,
                                 CollisionObject collisionObject,
                                 CollisionShape collisionShape,
                                 Transform colObjWorldTransform,
                                 CollisionWorld.RayResultCallback resultCallback)

objectQuerySingle

public static void objectQuerySingle(ConvexShape castShape,
                                     Transform convexFromTrans,
                                     Transform convexToTrans,
                                     CollisionObject collisionObject,
                                     CollisionShape collisionShape,
                                     Transform colObjWorldTransform,
                                     CollisionWorld.ConvexResultCallback resultCallback,
                                     float allowedPenetration)
objectQuerySingle performs a collision detection query and calls the resultCallback. It is used internally by rayTest.


rayTest

public void rayTest(Vector3f rayFromWorld,
                    Vector3f rayToWorld,
                    CollisionWorld.RayResultCallback resultCallback)
rayTest performs a raycast on all objects in the CollisionWorld, and calls the resultCallback. This allows for several queries: first hit, all hits, any hit, dependent on the value returned by the callback.


convexSweepTest

public void convexSweepTest(ConvexShape castShape,
                            Transform convexFromWorld,
                            Transform convexToWorld,
                            CollisionWorld.ConvexResultCallback resultCallback)
convexTest performs a swept convex cast on all objects in the CollisionWorld, and calls the resultCallback This allows for several queries: first hit, all hits, any hit, dependent on the value return by the callback.


getCollisionObjectArray

public ObjectArrayList<CollisionObject> getCollisionObjectArray()