use of com.bulletphysics.linearmath.Transform in project bdx by GoranM.
the class Stack method alloc.
public Transform alloc(Transform original) {
Transform t = allocTransform();
t.set(original);
return t;
}
use of com.bulletphysics.linearmath.Transform in project bdx by GoranM.
the class Stack method allocTransform.
public Transform allocTransform() {
types[sp++] = TYPE_TRANSFORM;
int pos = stackPositions[TYPE_TRANSFORM]++;
if (transformStack.size() <= pos) {
transformStack.add(new Transform());
}
return transformStack.get(pos);
}
use of com.bulletphysics.linearmath.Transform in project bdx by GoranM.
the class Camera method update.
public void update() {
Transform t = new Transform();
body.getWorldTransform(t);
data.position.set(t.origin.x, t.origin.y, t.origin.z);
Vector3f axis = axis("-Z");
data.direction.set(axis.x, axis.y, axis.z);
axis = axis("Y");
data.up.set(axis.x, axis.y, axis.z);
data.update();
}
use of com.bulletphysics.linearmath.Transform in project bdx by GoranM.
the class Camera method projection.
public void projection(Matrix4f mat) {
Transform t = new Transform(mat);
float[] m = new float[16];
t.getOpenGLMatrix(m);
data.projection.set(m);
}
use of com.bulletphysics.linearmath.Transform in project bdx by GoranM.
the class GameObject method transform.
public Matrix4f transform() {
Transform t = new Transform();
body.getWorldTransform(t);
Vector3f v = new Vector3f();
for (int i = 0; i < 3; ++i) {
t.basis.getColumn(i, v);
v.normalize();
t.basis.setColumn(i, v);
}
Matrix4f m = new Matrix4f();
t.getMatrix(m);
return m;
}
Aggregations