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