Search in sources :

Example 36 with Matrix3f

use of javax.vecmath.Matrix3f in project MinecraftForge by MinecraftForge.

the class TRSRTransformation method toAffine.

/*
     * Divides m by m33, sets last row to (0, 0, 0, 1), extracts linear and translation parts 
     */
public static Pair<Matrix3f, Vector3f> toAffine(Matrix4f m) {
    m.mul(1.f / m.m33);
    Vector3f trans = new Vector3f(m.m03, m.m13, m.m23);
    Matrix3f linear = new Matrix3f(m.m00, m.m01, m.m02, m.m10, m.m11, m.m12, m.m20, m.m21, m.m22);
    return Pair.of(linear, trans);
}
Also used : Matrix3f(javax.vecmath.Matrix3f) Vector3f(javax.vecmath.Vector3f)

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