List of usage examples for com.badlogic.gdx.math Matrix4 M30
int M30
To view the source code for com.badlogic.gdx.math Matrix4 M30.
Click Source Link
From source file:ve.ucv.ciens.ccg.nxtar.graphics.CustomPerspectiveCamera.java
License:Apache License
public void setCustomARProjectionMatrix(final float focalPointX, final float focalPointY, final float cameraCenterX, final float cameraCenterY, final float near, final float far, final float w, final float h) { final float FAR_PLUS_NEAR = far + near; final float FAR_LESS_NEAR = far - near; projection.val[Matrix4.M00] = -2.0f * focalPointX / w; projection.val[Matrix4.M10] = 0.0f; projection.val[Matrix4.M20] = 0.0f; projection.val[Matrix4.M30] = 0.0f; projection.val[Matrix4.M01] = 0.0f; projection.val[Matrix4.M11] = 2.0f * focalPointY / h; projection.val[Matrix4.M21] = 0.0f; projection.val[Matrix4.M31] = 0.0f; projection.val[Matrix4.M02] = 2.0f * cameraCenterX / w - 1.0f; projection.val[Matrix4.M12] = 2.0f * cameraCenterY / h - 1.0f; projection.val[Matrix4.M22] = -FAR_PLUS_NEAR / FAR_LESS_NEAR; projection.val[Matrix4.M32] = -1.0f; projection.val[Matrix4.M03] = 0.0f; projection.val[Matrix4.M13] = 0.0f; projection.val[Matrix4.M23] = -2.0f * far * near / FAR_LESS_NEAR; projection.val[Matrix4.M33] = 0.0f; }
From source file:ve.ucv.ciens.ccg.nxtar.systems.GeometrySystem.java
License:Apache License
private void applyWorldTransform(ModelInstance model, GeometryComponent geometry) { translationMatrix.setToTranslation(geometry.position); rotationMatrix.val[Matrix4.M00] = geometry.rotation.val[0]; rotationMatrix.val[Matrix4.M10] = geometry.rotation.val[1]; rotationMatrix.val[Matrix4.M20] = geometry.rotation.val[2]; rotationMatrix.val[Matrix4.M30] = 0; rotationMatrix.val[Matrix4.M01] = geometry.rotation.val[3]; rotationMatrix.val[Matrix4.M11] = geometry.rotation.val[4]; rotationMatrix.val[Matrix4.M21] = geometry.rotation.val[5]; rotationMatrix.val[Matrix4.M31] = 0; rotationMatrix.val[Matrix4.M02] = geometry.rotation.val[6]; rotationMatrix.val[Matrix4.M12] = geometry.rotation.val[7]; rotationMatrix.val[Matrix4.M22] = geometry.rotation.val[8]; rotationMatrix.val[Matrix4.M32] = 0; rotationMatrix.val[Matrix4.M03] = 0; rotationMatrix.val[Matrix4.M13] = 0; rotationMatrix.val[Matrix4.M23] = 0; rotationMatrix.val[Matrix4.M33] = 1; scalingMatrix.setToScaling(geometry.scaling); model.transform.idt().mul(translationMatrix).mul(rotationMatrix).mul(scalingMatrix); model.calculateTransforms();// w w w. ja v a 2 s .co m }