use of com.bulletphysics.collision.broadphase.BroadphaseNativeType in project bdx by GoranM.
the class CollisionWorld method addCollisionObject.
public void addCollisionObject(CollisionObject collisionObject, short collisionFilterGroup, short collisionFilterMask) {
// check that the object isn't already added
assert (!collisionObjects.contains(collisionObject));
Stack stack = Stack.enter();
collisionObjects.add(collisionObject);
// calculate new AABB
// TODO: check if it's overwritten or not
Transform trans = collisionObject.getWorldTransform(stack.allocTransform());
Vector3f minAabb = stack.allocVector3f();
Vector3f maxAabb = stack.allocVector3f();
collisionObject.getCollisionShape().getAabb(trans, minAabb, maxAabb);
BroadphaseNativeType type = collisionObject.getCollisionShape().getShapeType();
collisionObject.setBroadphaseHandle(getBroadphase().createProxy(minAabb, maxAabb, type, collisionObject, collisionFilterGroup, collisionFilterMask, dispatcher1, null));
stack.leave();
}
Aggregations