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


Java Matrix3f.mult方法代码示例

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


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

示例1: rotateCamera

import com.jme3.math.Matrix3f; //导入方法依赖的package包/类
protected void rotateCamera(float value, Vector3f axis){
        if (dragToRotate){
            if (canRotate){
//                value = -value;
            }else{
                return;
            }
        }

        Matrix3f mat = new Matrix3f();
        mat.fromAngleNormalAxis(rotationSpeed * value, axis);

        Vector3f up = cam.getUp();
        Vector3f left = cam.getLeft();
        Vector3f dir = cam.getDirection();

        mat.mult(up, up);
        mat.mult(left, left);
        mat.mult(dir, dir);

        Quaternion q = new Quaternion();
        q.fromAxes(left, up, dir);
        q.normalize();

        cam.setAxes(q);
    }
 
开发者ID:mleoking,项目名称:PhET,代码行数:27,代码来源:FlyByCamera.java

示例2: changeRotation

import com.jme3.math.Matrix3f; //导入方法依赖的package包/类
protected void changeRotation(float value, Point3D axis){
	Matrix3f mat = new Matrix3f();
	mat.fromAngleNormalAxis(value, TranslateUtil.toVector3f(axis));

	Vector3f up = cam.getUp();
	Vector3f left = cam.getLeft();
	Vector3f dir = cam.getDirection();

	mat.mult(up, up);
	mat.mult(left, left);
	mat.mult(dir, dir);

	rotation = new Quaternion();
	rotation.fromAxes(left, up, dir);
	rotation.normalizeLocal();

	applyRotationToCam();
}
 
开发者ID:methusalah,项目名称:OpenRTS,代码行数:19,代码来源:GroundCameraManager.java

示例3: rotateCamera

import com.jme3.math.Matrix3f; //导入方法依赖的package包/类
protected void rotateCamera(float value, Vector3f axis){
        if (dragToRotate){
            if (canRotate){
//                value = -value;
            }else{
                return;
            }
        }

        Matrix3f mat = new Matrix3f();
        mat.fromAngleNormalAxis(rotationSpeed * value, axis);

        Vector3f up = cam.getUp();
        Vector3f left = cam.getLeft();
        Vector3f dir = cam.getDirection();

        mat.mult(up, up);
        mat.mult(left, left);
        mat.mult(dir, dir);

        Quaternion q = new Quaternion();
        q.fromAxes(left, up, dir);

        cam.setAxes(q);
    }
 
开发者ID:methusalah,项目名称:OpenRTS,代码行数:26,代码来源:StaticCamera.java

示例4: rotateCamera

import com.jme3.math.Matrix3f; //导入方法依赖的package包/类
private void rotateCamera(float value, Vector3f axis){
        if (dragToRotate){
            if (canRotate){
//                value = -value;
            }else{
                return;
            }
        }

        Matrix3f mat = new Matrix3f();
        mat.fromAngleNormalAxis(rotationSpeed * value, axis);

        Vector3f up = cam.getUp();
        Vector3f left = cam.getLeft();
        Vector3f dir = cam.getDirection();

        mat.mult(up, up);
        mat.mult(left, left);
        mat.mult(dir, dir);

        Quaternion q = new Quaternion();
        q.fromAxes(left, up, dir);
        q.normalizeLocal();

        cam.setAxes(q);
    }
 
开发者ID:lyrgard,项目名称:HexScape,代码行数:27,代码来源:FlyByCamera.java

示例5: rotateCamera

import com.jme3.math.Matrix3f; //导入方法依赖的package包/类
private void rotateCamera(float value, Vector3f axis){


		Matrix3f mat = new Matrix3f();
		mat.fromAngleNormalAxis(rotationSpeed * value, axis);

		Vector3f up = cam.getUp();
		Vector3f left = cam.getLeft();
		Vector3f dir = cam.getDirection();

		mat.mult(up, up);
		mat.mult(left, left);
		mat.mult(dir, dir);

		Quaternion q = new Quaternion();
		q.fromAxes(left, up, dir);
		q.normalizeLocal();

		cam.setAxes(q);
	}
 
开发者ID:lyrgard,项目名称:HexScape,代码行数:21,代码来源:PointOfViewCamera.java

示例6: rotateCamera

import com.jme3.math.Matrix3f; //导入方法依赖的package包/类
private void rotateCamera(float value, Vector3f axis) {
	Matrix3f mat = new Matrix3f();
	mat.fromAngleNormalAxis(ROTATION_SPEED * value, axis);
	Vector3f up = cam.getUp();
	Vector3f left = cam.getLeft();
	Vector3f dir = cam.getDirection();

	mat.mult(up, up);
	mat.mult(left, left);
	mat.mult(dir, dir);

	Quaternion q = new Quaternion();
	q.fromAxes(left, up, dir);
	q.normalizeLocal();
       if (up.angleBetween(Vector3f.UNIT_Y) <= FastMath.HALF_PI) {
           cam.setAxes(q);
       }
}
 
开发者ID:mosstest,项目名称:mosstest,代码行数:19,代码来源:RotationListener.java

示例7: rotateCamera

import com.jme3.math.Matrix3f; //导入方法依赖的package包/类
protected void rotateCamera(float value, Vector3f axis){
        if (dragToRotate){
            if (canRotate){
//                value = -value;
            }else{
                return;
            }
        }

        Matrix3f mat = new Matrix3f();
        mat.fromAngleNormalAxis(rotationSpeed * value, axis);

        Vector3f up = cam.getUp();
        Vector3f left = cam.getLeft();
        Vector3f dir = cam.getDirection();

        mat.mult(up, up);
        mat.mult(left, left);
        mat.mult(dir, dir);

        Quaternion q = new Quaternion();
        q.fromAxes(left, up, dir);
        q.normalizeLocal();

        cam.setAxes(q);
    }
 
开发者ID:chototsu,项目名称:MikuMikuStudio,代码行数:27,代码来源:FlyByCamera.java

示例8: transform

import com.jme3.math.Matrix3f; //导入方法依赖的package包/类
/**
 * <code>transform</code> modifies the center of the box to reflect the
 * change made via a rotation, translation and scale.
 * 
 * @param trans 
 *            the transform to apply
 * @param store
 *            box to store result in
 */
public BoundingVolume transform(Transform trans, BoundingVolume store) {

    BoundingBox box;
    if (store == null || store.getType() != Type.AABB) {
        box = new BoundingBox();
    } else {
        box = (BoundingBox) store;
    }

    center.mult(trans.getScale(), box.center);
    trans.getRotation().mult(box.center, box.center);
    box.center.addLocal(trans.getTranslation());

    TempVars vars = TempVars.get();

    Matrix3f transMatrix = vars.tempMat3;
    transMatrix.set(trans.getRotation());
    // Make the rotation matrix all positive to get the maximum x/y/z extent
    transMatrix.absoluteLocal();

    Vector3f scale = trans.getScale();
    vars.vect1.set(xExtent * scale.x, yExtent * scale.y, zExtent * scale.z);
    transMatrix.mult(vars.vect1, vars.vect2);
    // Assign the biggest rotations after scales.
    box.xExtent = FastMath.abs(vars.vect2.getX());
    box.yExtent = FastMath.abs(vars.vect2.getY());
    box.zExtent = FastMath.abs(vars.vect2.getZ());

    vars.release();

    return box;
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:42,代码来源:BoundingBox.java

示例9: rotateCamera

import com.jme3.math.Matrix3f; //导入方法依赖的package包/类
protected void rotateCamera(float value, Vector3f axis, boolean ignoreDragging){
        if (dragToRotate && !ignoreDragging){
            if (canRotate){
//                value = -value;
            }else{
                return;
            }
        }
		if (!ignoreDragging && !canRotate) {
			return;
		}

        Matrix3f mat = new Matrix3f();
        mat.fromAngleNormalAxis(rotationSpeed * value, axis);

        Vector3f up = cam.getUp();
        Vector3f left = cam.getLeft();
        Vector3f dir = cam.getDirection();

        mat.mult(up, up);
        mat.mult(left, left);
        mat.mult(dir, dir);

        Quaternion q = new Quaternion();
        q.fromAxes(left, up, dir);
        q.normalizeLocal();

        cam.setAxes(q);
    }
 
开发者ID:shamanDevel,项目名称:ProceduralTerrain,代码行数:30,代码来源:CustomFlyByCamera.java


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