本文整理汇总了Java中com.badlogic.gdx.math.Matrix4.inv方法的典型用法代码示例。如果您正苦于以下问题:Java Matrix4.inv方法的具体用法?Java Matrix4.inv怎么用?Java Matrix4.inv使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.badlogic.gdx.math.Matrix4
的用法示例。
在下文中一共展示了Matrix4.inv方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: UpdateViewMatrix
import com.badlogic.gdx.math.Matrix4; //导入方法依赖的package包/类
private void UpdateViewMatrix()
{
Matrix4 cameraRotation = new Matrix4();
cameraRotation = Utils.createRotate(updownRot, leftrightRot, 0f, cameraRotation);
Vector3 cameraOriginalTarget = new Vector3(0, 0, -1);
Vector3 cameraOriginalUpVector = new Vector3(0, 1, 0);
// cameraRotation.rotate(1, 0, 0, cameraOriginalTarget.x);
Vector3 cameraRotatedTarget = Utils.Transform(cameraOriginalTarget, cameraRotation);
Vector3 cameraFinalTarget = Utils.addVector(position,cameraRotatedTarget);
up.set(Utils.Transform(cameraOriginalUpVector, cameraRotation));
view.setToLookAt(position, cameraFinalTarget, up);
float aspect = viewportWidth / viewportHeight;
projection.setToProjection(Math.abs(near), Math.abs(far), fieldOfView, aspect);
combined.set(projection);
Matrix4.mul(combined.val, view.val);
invProjectionView.set(combined);
Matrix4.inv(invProjectionView.val);
frustum.update(invProjectionView);
}
示例2: UpdateViewMatrix
import com.badlogic.gdx.math.Matrix4; //导入方法依赖的package包/类
/**
* Update camera's matrix
*/
private void UpdateViewMatrix()
{
Matrix4 cameraRotation = new Matrix4();
cameraRotation = Utils.createRotate(updownRot, leftrightRot, 0f, cameraRotation);
Vector3 cameraOriginalTarget = new Vector3(0, 0, -1);
Vector3 cameraOriginalUpVector = new Vector3(0, 1, 0);
// cameraRotation.rotate(1, 0, 0, cameraOriginalTarget.x);
Vector3 cameraRotatedTarget = Utils.Transform(cameraOriginalTarget, cameraRotation);
Vector3 cameraFinalTarget = Utils.addVector(position,cameraRotatedTarget);
up.set(Utils.Transform(cameraOriginalUpVector, cameraRotation));
view.setToLookAt(position, cameraFinalTarget, up);
float aspect = viewportWidth / viewportHeight;
projection.setToProjection(Math.abs(near), Math.abs(far), fieldOfView, aspect);
combined.set(projection);
Matrix4.mul(combined.val, view.val);
invProjectionView.set(combined);
Matrix4.inv(invProjectionView.val);
frustum.update(invProjectionView);
}
示例3: updateFrustum
import com.badlogic.gdx.math.Matrix4; //导入方法依赖的package包/类
public void updateFrustum()
{
invProjectionView.set(combined);
Matrix4.inv(invProjectionView.val);
frustum.update(invProjectionView);
needUpdateFrustum = false;
}
示例4: update
import com.badlogic.gdx.math.Matrix4; //导入方法依赖的package包/类
@Override
public void update(){
combined.set(projection);
Matrix4.mul(combined.val, view.val);
invProjectionView.set(combined);
Matrix4.inv(invProjectionView.val);
frustum.update(invProjectionView);
}
示例5: update
import com.badlogic.gdx.math.Matrix4; //导入方法依赖的package包/类
@Override
public void update(boolean updateFrustum) {
// get the projection matrix from the HDM
VRSystem.VRSystem_GetProjectionMatrix(eye.index, near, far, projectionMat);
VRContext.hmdMat4toMatrix4(projectionMat, projection);
// get the eye space matrix from the HDM
VRSystem.VRSystem_GetEyeToHeadTransform(eye.index, eyeMat);
VRContext.hmdMat34ToMatrix4(eyeMat, eyeSpace);
invEyeSpace.set(eyeSpace).inv();
// get the pose matrix from the HDM
VRDevice hmd = context.getDeviceByType(VRDeviceType.HeadMountedDisplay);
Vector3 y = hmd.getUp(Space.World);
Vector3 z = hmd.getDirection(Space.World);
Vector3 p = hmd.getPosition(Space.World);
view.idt();
view.setToLookAt(p, tmp.set(p).add(z), y);
position.set(p);
direction.set(z);
up.set(y);
combined.set(projection);
Matrix4.mul(combined.val, invEyeSpace.val);
Matrix4.mul(combined.val, view.val);
if (updateFrustum) {
invProjectionView.set(combined);
Matrix4.inv(invProjectionView.val);
frustum.update(invProjectionView);
}
}
示例6: update
import com.badlogic.gdx.math.Matrix4; //导入方法依赖的package包/类
@Override
public void update (boolean updateFrustum) {
view.setToLookAt(position, tmp.set(position).add(direction), up);
combined.set(projection);
Matrix4.mul(combined.val, view.val);
if (updateFrustum) {
invProjectionView.set(combined);
Matrix4.inv(invProjectionView.val);
frustum.update(invProjectionView);
}
}