当前位置: 首页>>代码示例>>Java>>正文


Java Matrix4.inv方法代码示例

本文整理汇总了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);

   }
 
开发者ID:game-libgdx-unity,项目名称:GDX-Engine,代码行数:26,代码来源:BirdEyeCamera.java

示例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);

   }
 
开发者ID:game-libgdx-unity,项目名称:GDX-Engine,代码行数:29,代码来源:FreeCamera.java

示例3: updateFrustum

import com.badlogic.gdx.math.Matrix4; //导入方法依赖的package包/类
public void updateFrustum()
{
	invProjectionView.set(combined);
	Matrix4.inv(invProjectionView.val);
	frustum.update(invProjectionView);
	needUpdateFrustum = false;
	
}
 
开发者ID:game-libgdx-unity,项目名称:GDX-Engine,代码行数:9,代码来源:BaseCamera.java

示例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);
   }
 
开发者ID:game-libgdx-unity,项目名称:GDX-Engine,代码行数:10,代码来源:ChaseCamera.java

示例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);
	}
}
 
开发者ID:justinmarentette11,项目名称:Tower-Defense-Galaxy,代码行数:35,代码来源:VRCamera.java

示例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);
    }
}
 
开发者ID:GLUD,项目名称:trascendentAR,代码行数:13,代码来源:ARCamera.java


注:本文中的com.badlogic.gdx.math.Matrix4.inv方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。