本文整理汇总了Java中org.saintandreas.math.Matrix4f类的典型用法代码示例。如果您正苦于以下问题:Java Matrix4f类的具体用法?Java Matrix4f怎么用?Java Matrix4f使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Matrix4f类属于org.saintandreas.math包,在下文中一共展示了Matrix4f类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: withPush
import org.saintandreas.math.Matrix4f; //导入依赖的package包/类
public MatrixStack withPush(Matrix4f m, Runnable closure) {
withPush(()->{
set(m);
closure.run();
});
return this;
}
示例2: recenterView
import org.saintandreas.math.Matrix4f; //导入依赖的package包/类
private void recenterView() {
Vector3f center = Vector3f.UNIT_Y.mult(eyeHeight);
// Vector3f eye = new Vector3f(0, eyeHeight, ipd * 10.0f); //jherico
Vector3f eye = new Vector3f(ipd * 5.0f, eyeHeight, 0.0f);
player = Matrix4f.lookat(eye, center, Vector3f.UNIT_Y).invert();
// worldToCamera = Matrix4f.lookat(eye, center, Vector3f.UNIT_Y);
hmd.recenterPose();
}
示例3: toMatrix4f
import org.saintandreas.math.Matrix4f; //导入依赖的package包/类
public static Matrix4f toMatrix4f(OvrMatrix4f m) {
if (null == m) {
return new Matrix4f();
}
return new Matrix4f(m.M).transpose();
}
示例4: setUniform
import org.saintandreas.math.Matrix4f; //导入依赖的package包/类
public void setUniform(final String name, Matrix4f m) {
FloatBuffer fb = BufferUtils.getFloatBuffer(16);
m.fillFloatBuffer(fb, true);
fb.position(0);
setUniformMatrix4(name, fb);
}
示例5: getTransform
import org.saintandreas.math.Matrix4f; //导入依赖的package包/类
@Override
public Matrix4f getTransform() {
return transform;
}
示例6: set
import org.saintandreas.math.Matrix4f; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public T set(Matrix4f m) {
transform = m;
return (T) this;
}
示例7: identity
import org.saintandreas.math.Matrix4f; //导入依赖的package包/类
@Override
public T identity() {
return set(new Matrix4f());
}
示例8: multiply
import org.saintandreas.math.Matrix4f; //导入依赖的package包/类
@Override
public T multiply(Matrix4f m) {
return set(getTransform().mult(m));
}
示例9: preMultiply
import org.saintandreas.math.Matrix4f; //导入依赖的package包/类
@Override
public T preMultiply(Matrix4f m) {
return set(m.mult(getTransform()));
}
示例10: preTranslate
import org.saintandreas.math.Matrix4f; //导入依赖的package包/类
@Override
public T preTranslate(Vector2f v) {
return preMultiply(new Matrix4f().translate(v));
}
示例11: preRotate
import org.saintandreas.math.Matrix4f; //导入依赖的package包/类
@Override
public T preRotate(float angle, Vector3f axis) {
return preMultiply(new Matrix4f().rotate(angle, axis));
}
示例12: lookat
import org.saintandreas.math.Matrix4f; //导入依赖的package包/类
@Override
public T lookat(Vector3f eye, Vector3f center, Vector3f up) {
return set(Matrix4f.lookat(eye, center, up));
}
示例13: orthographic
import org.saintandreas.math.Matrix4f; //导入依赖的package包/类
@Override
public T orthographic(float left, float right, float bottom, float top, float near, float far) {
return set(Matrix4f.orthographic(left, right, bottom, top, near, far));
}
示例14: perspective
import org.saintandreas.math.Matrix4f; //导入依赖的package包/类
@Override
public T perspective(float fovy, float aspect, float zNear, float zFar) {
return set(Matrix4f.perspective(fovy, aspect, zNear, zFar));
}
示例15: unrotate
import org.saintandreas.math.Matrix4f; //导入依赖的package包/类
public T unrotate() {
return set(new Matrix4f().translate(getTranslation()));
}