List of usage examples for com.badlogic.gdx.math Matrix4 Matrix4
public Matrix4(Vector3 position, Quaternion rotation, Vector3 scale)
From source file:net.smert.frameworkgl.examples.common.BulletGameObjectFactory.java
License:Apache License
public BulletGameObject create(String name, Transform4f worldTransform) { Integer existingIndex = nameToIndex.get(name); if (existingIndex == null) { return null; }//w w w. j a va2s .c o m BulletGameObject.Constructor constructor = constructors.get(existingIndex); Quaternion4f rotation = new Quaternion4f(worldTransform.getRotation()); Vector3f position = worldTransform.getPosition(); Quaternion newRotation = new Quaternion(rotation.getX(), rotation.getY(), rotation.getZ(), rotation.getW()); Vector3 newPosition = new Vector3(position.getX(), position.getY(), position.getZ()); Vector3 newScale = new Vector3(1f, 1f, 1f); return constructor.create(new Matrix4(newPosition, newRotation, newScale)); }