Search in sources :

Example 11 with Matrix3f

use of javax.vecmath.Matrix3f in project bdx by GoranM.

the class Stack method allocMatrix3f.

public Matrix3f allocMatrix3f() {
    types[sp++] = TYPE_MATRIX3F;
    int pos = stackPositions[TYPE_MATRIX3F]++;
    if (matrix3fStack.size() <= pos) {
        matrix3fStack.add(new Matrix3f());
    }
    return matrix3fStack.get(pos);
}
Also used : Matrix3f(javax.vecmath.Matrix3f)

Example 12 with Matrix3f

use of javax.vecmath.Matrix3f in project bdx by GoranM.

the class Stack method alloc.

public Matrix3f alloc(Matrix3f original) {
    Matrix3f m = allocMatrix3f();
    m.set(original);
    return m;
}
Also used : Matrix3f(javax.vecmath.Matrix3f)

Example 13 with Matrix3f

use of javax.vecmath.Matrix3f in project bdx by GoranM.

the class GameObject method rotate.

public void rotate(float x, float y, float z) {
    Matrix3f ori = orientation();
    Matrix3f rot = new Matrix3f();
    MatrixUtil.setEulerZYX(rot, x, y, z);
    rot.mul(ori);
    orientation(rot);
}
Also used : Matrix3f(javax.vecmath.Matrix3f)

Example 14 with Matrix3f

use of javax.vecmath.Matrix3f in project bdx by GoranM.

the class GameObject method orientation.

public Matrix3f orientation() {
    Matrix4f t = transform();
    Matrix3f ori = new Matrix3f();
    t.getRotationScale(ori);
    return ori;
}
Also used : Matrix4f(javax.vecmath.Matrix4f) Matrix3f(javax.vecmath.Matrix3f)

Example 15 with Matrix3f

use of javax.vecmath.Matrix3f in project bdx by GoranM.

the class GameObject method rotateLocal.

public void rotateLocal(float x, float y, float z) {
    Matrix3f ori = orientation();
    Matrix3f rot = new Matrix3f();
    MatrixUtil.setEulerZYX(rot, x, y, z);
    ori.mul(rot);
    orientation(ori);
}
Also used : Matrix3f(javax.vecmath.Matrix3f)

Aggregations

Matrix3f (javax.vecmath.Matrix3f)36 Vector3f (javax.vecmath.Vector3f)25 Stack (com.bulletphysics.util.Stack)23 Transform (com.bulletphysics.linearmath.Transform)8 Quat4f (javax.vecmath.Quat4f)5 RigidBody (com.bulletphysics.dynamics.RigidBody)4 ManifoldPoint (com.bulletphysics.collision.narrowphase.ManifoldPoint)3 Matrix4f (javax.vecmath.Matrix4f)3 MeshPart (com.badlogic.gdx.graphics.g3d.model.MeshPart)2 Model (com.badlogic.gdx.graphics.g3d.Model)1 Node (com.badlogic.gdx.graphics.g3d.model.Node)1 NodePart (com.badlogic.gdx.graphics.g3d.model.NodePart)1 MeshPartBuilder (com.badlogic.gdx.graphics.g3d.utils.MeshPartBuilder)1 ModelBuilder (com.badlogic.gdx.graphics.g3d.utils.ModelBuilder)1 Matrix3 (com.badlogic.gdx.math.Matrix3)1 Vector3 (com.badlogic.gdx.math.Vector3)1 BoundingBox (com.badlogic.gdx.math.collision.BoundingBox)1 CollisionObject (com.bulletphysics.collision.dispatch.CollisionObject)1 ConvexCast (com.bulletphysics.collision.narrowphase.ConvexCast)1 CastResult (com.bulletphysics.collision.narrowphase.ConvexCast.CastResult)1