Search in sources :

Example 16 with AABB

use of com.bulletphysics.extras.gimpact.BoxCollision.AABB in project bdx by GoranM.

the class TriangleShapeEx method getAabb.

@Override
public void getAabb(Transform t, Vector3f aabbMin, Vector3f aabbMax) {
    Stack stack = Stack.enter();
    Vector3f tv0 = stack.alloc(vertices1[0]);
    t.transform(tv0);
    Vector3f tv1 = stack.alloc(vertices1[1]);
    t.transform(tv1);
    Vector3f tv2 = stack.alloc(vertices1[2]);
    t.transform(tv2);
    AABB trianglebox = stack.allocAABB();
    trianglebox.init(tv0, tv1, tv2, collisionMargin);
    aabbMin.set(trianglebox.min);
    aabbMax.set(trianglebox.max);
    stack.leave();
}
Also used : Vector3f(javax.vecmath.Vector3f) AABB(com.bulletphysics.extras.gimpact.BoxCollision.AABB) Stack(com.bulletphysics.util.Stack)

Example 17 with AABB

use of com.bulletphysics.extras.gimpact.BoxCollision.AABB in project bdx by GoranM.

the class Stack method allocAABB.

public AABB allocAABB() {
    types[sp++] = TYPE_AABB;
    int pos = stackPositions[TYPE_AABB]++;
    if (aabbStack.size() <= pos) {
        aabbStack.add(new AABB());
    }
    return aabbStack.get(pos);
}
Also used : AABB(com.bulletphysics.extras.gimpact.BoxCollision.AABB)

Aggregations

AABB (com.bulletphysics.extras.gimpact.BoxCollision.AABB)17 Stack (com.bulletphysics.util.Stack)15 Transform (com.bulletphysics.linearmath.Transform)2 Vector3f (javax.vecmath.Vector3f)2 StaticPlaneShape (com.bulletphysics.collision.shapes.StaticPlaneShape)1 Vector4f (javax.vecmath.Vector4f)1