Search in sources :

Example 11 with Quaternion

use of com.badlogic.gdx.math.Quaternion in project nhglib by VoidZombie.

the class NodeComponent method reset.

@Override
protected void reset() {
    node.translation.set(VectorPool.getVector3());
    node.rotation.set(new Quaternion());
    node.scale.set(VectorPool.getVector3());
    translationDelta.set(Vector3.Zero);
    rotationDelta.set(Vector3.Zero);
    scaleDelta.set(Vector3.Zero);
}
Also used : Quaternion(com.badlogic.gdx.math.Quaternion)

Example 12 with Quaternion

use of com.badlogic.gdx.math.Quaternion in project nhglib by VoidZombie.

the class NodeComponent method setTransform.

public void setTransform(Matrix4 transform) {
    if (transform != null) {
        Vector3 translation = VectorPool.getVector3();
        Vector3 scale = VectorPool.getVector3();
        Quaternion rotation = QuaternionPool.getQuaternion();
        transform.getTranslation(translation);
        transform.getRotation(rotation);
        transform.getScale(scale);
        setTranslation(translation);
        setRotation(rotation);
        setScale(scale);
        VectorPool.freeVector3(translation, scale);
        QuaternionPool.freeQuaternion(rotation);
    }
}
Also used : Quaternion(com.badlogic.gdx.math.Quaternion) Vector3(com.badlogic.gdx.math.Vector3)

Aggregations

Quaternion (com.badlogic.gdx.math.Quaternion)12 Vector3 (com.badlogic.gdx.math.Vector3)9 NodeKeyframe (com.badlogic.gdx.graphics.g3d.model.NodeKeyframe)3 ModelNode (com.badlogic.gdx.graphics.g3d.model.data.ModelNode)3 Matrix4 (com.badlogic.gdx.math.Matrix4)3 Animation (com.badlogic.gdx.graphics.g3d.model.Animation)2 Node (com.badlogic.gdx.graphics.g3d.model.Node)2 NodeAnimation (com.badlogic.gdx.graphics.g3d.model.NodeAnimation)2 ModelAnimation (com.badlogic.gdx.graphics.g3d.model.data.ModelAnimation)2 ModelNodeAnimation (com.badlogic.gdx.graphics.g3d.model.data.ModelNodeAnimation)2 ModelNodeKeyframe (com.badlogic.gdx.graphics.g3d.model.data.ModelNodeKeyframe)2 ModelNodePart (com.badlogic.gdx.graphics.g3d.model.data.ModelNodePart)2 Array (com.badlogic.gdx.utils.Array)2 JsonValue (com.badlogic.gdx.utils.JsonValue)2 VertexAttribute (com.badlogic.gdx.graphics.VertexAttribute)1 ModelData (com.badlogic.gdx.graphics.g3d.model.data.ModelData)1 ModelMaterial (com.badlogic.gdx.graphics.g3d.model.data.ModelMaterial)1 ModelMesh (com.badlogic.gdx.graphics.g3d.model.data.ModelMesh)1 ModelMeshPart (com.badlogic.gdx.graphics.g3d.model.data.ModelMeshPart)1 FloatArray (com.badlogic.gdx.utils.FloatArray)1