Search in sources :

Example 36 with Transform

use of com.bulletphysics.linearmath.Transform in project bdx by GoranM.

the class Stack method alloc.

public Transform alloc(Transform original) {
    Transform t = allocTransform();
    t.set(original);
    return t;
}
Also used : Transform(com.bulletphysics.linearmath.Transform)

Example 37 with Transform

use of com.bulletphysics.linearmath.Transform in project bdx by GoranM.

the class Stack method allocTransform.

public Transform allocTransform() {
    types[sp++] = TYPE_TRANSFORM;
    int pos = stackPositions[TYPE_TRANSFORM]++;
    if (transformStack.size() <= pos) {
        transformStack.add(new Transform());
    }
    return transformStack.get(pos);
}
Also used : Transform(com.bulletphysics.linearmath.Transform)

Example 38 with Transform

use of com.bulletphysics.linearmath.Transform in project bdx by GoranM.

the class Camera method update.

public void update() {
    Transform t = new Transform();
    body.getWorldTransform(t);
    data.position.set(t.origin.x, t.origin.y, t.origin.z);
    Vector3f axis = axis("-Z");
    data.direction.set(axis.x, axis.y, axis.z);
    axis = axis("Y");
    data.up.set(axis.x, axis.y, axis.z);
    data.update();
}
Also used : Vector3f(javax.vecmath.Vector3f) Transform(com.bulletphysics.linearmath.Transform)

Example 39 with Transform

use of com.bulletphysics.linearmath.Transform in project bdx by GoranM.

the class Camera method projection.

public void projection(Matrix4f mat) {
    Transform t = new Transform(mat);
    float[] m = new float[16];
    t.getOpenGLMatrix(m);
    data.projection.set(m);
}
Also used : Transform(com.bulletphysics.linearmath.Transform)

Example 40 with Transform

use of com.bulletphysics.linearmath.Transform in project bdx by GoranM.

the class GameObject method transform.

public Matrix4f transform() {
    Transform t = new Transform();
    body.getWorldTransform(t);
    Vector3f v = new Vector3f();
    for (int i = 0; i < 3; ++i) {
        t.basis.getColumn(i, v);
        v.normalize();
        t.basis.setColumn(i, v);
    }
    Matrix4f m = new Matrix4f();
    t.getMatrix(m);
    return m;
}
Also used : Matrix4f(javax.vecmath.Matrix4f) Vector3f(javax.vecmath.Vector3f) Transform(com.bulletphysics.linearmath.Transform) ManifoldPoint(com.bulletphysics.collision.narrowphase.ManifoldPoint)

Aggregations

Transform (com.bulletphysics.linearmath.Transform)81 Stack (com.bulletphysics.util.Stack)65 Vector3f (javax.vecmath.Vector3f)53 CollisionShape (com.bulletphysics.collision.shapes.CollisionShape)11 ManifoldPoint (com.bulletphysics.collision.narrowphase.ManifoldPoint)10 CompoundShape (com.bulletphysics.collision.shapes.CompoundShape)10 CollisionObject (com.bulletphysics.collision.dispatch.CollisionObject)9 Matrix3f (javax.vecmath.Matrix3f)8 TypedConstraint (com.bulletphysics.dynamics.constraintsolver.TypedConstraint)7 SphereShape (com.bulletphysics.collision.shapes.SphereShape)5 ConcaveShape (com.bulletphysics.collision.shapes.ConcaveShape)4 ConvexShape (com.bulletphysics.collision.shapes.ConvexShape)4 PersistentManifold (com.bulletphysics.collision.narrowphase.PersistentManifold)3 VoronoiSimplexSolver (com.bulletphysics.collision.narrowphase.VoronoiSimplexSolver)3 StaticPlaneShape (com.bulletphysics.collision.shapes.StaticPlaneShape)3 BroadphaseInterface (com.bulletphysics.collision.broadphase.BroadphaseInterface)2 ConvexCast (com.bulletphysics.collision.narrowphase.ConvexCast)2 CastResult (com.bulletphysics.collision.narrowphase.ConvexCast.CastResult)2 GjkConvexCast (com.bulletphysics.collision.narrowphase.GjkConvexCast)2 SubsimplexConvexCast (com.bulletphysics.collision.narrowphase.SubsimplexConvexCast)2