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);
}
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);
}
}
Aggregations