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


Java Matrix4.mul方法代码示例

本文整理汇总了Java中com.badlogic.gdx.math.Matrix4.mul方法的典型用法代码示例。如果您正苦于以下问题:Java Matrix4.mul方法的具体用法?Java Matrix4.mul怎么用?Java Matrix4.mul使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.badlogic.gdx.math.Matrix4的用法示例。


在下文中一共展示了Matrix4.mul方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: GLToClipTransform

import com.badlogic.gdx.math.Matrix4; //导入方法依赖的package包/类
public static void GLToClipTransform(Matrix4 transformOut) {
        if(null == transformOut) return;
        
        Director director = Director.getInstance();

        Matrix4 projection = director.getMatrix(MATRIX_STACK_TYPE.MATRIX_STACK_PROJECTION);
        Matrix4 modelview = director.getMatrix(MATRIX_STACK_TYPE.MATRIX_STACK_MODELVIEW);
        
//        System.out.println(projection);
//        System.out.println(modelview);
        
        //?
        transformOut.set(projection);
        transformOut.mul(modelview);
//        *transformOut = projection * modelview;
    }
 
开发者ID:mingwuyun,项目名称:cocos2d-java,代码行数:17,代码来源:Director.java

示例2: 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

示例3: 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

示例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: begin

import com.badlogic.gdx.math.Matrix4; //导入方法依赖的package包/类
/**
 * Starts a new batch of shapes. Shapes drawn within the batch will attempt to use the type specified. The call to this method
 * must be paired with a call to {@link #end()}.
 *
 * @see #setAutoShapeType(boolean)
 */
public void begin(ShapeType type) {
    if (shapeType != null)
        throw new IllegalStateException("Call end() before beginning a new shape batch.");
    shapeType = type;
    if (matrixDirty) {
        combinedMatrix.set(projectionMatrix);
        Matrix4.mul(combinedMatrix.val, transformMatrix.val);
        matrixDirty = false;
    }
    renderer.begin(combinedMatrix, shapeType.getGlType());
}
 
开发者ID:MiniDigger,项目名称:projecttd,代码行数:18,代码来源:ArcRenderer.java

示例6: 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

示例7: 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

示例8: mulMatrix

import com.badlogic.gdx.math.Matrix4; //导入方法依赖的package包/类
/**
    * Multiply the mx1 and mx2, mx1 and mx2 will not be changed
    * 
    * @param m1
    * @param m2
    * @return
    */
   public static Matrix4 mulMatrix(Matrix4 m1, Matrix4 m2) {
Matrix4 mx1 = new Matrix4(m1.val);
Matrix4 mx2 = new Matrix4(m2.val);

return mx1.mul(mx2);
   }
 
开发者ID:game-libgdx-unity,项目名称:GDX-Engine,代码行数:14,代码来源:Utils.java


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