本文整理汇总了Java中com.jme3.math.Matrix4f.loadIdentity方法的典型用法代码示例。如果您正苦于以下问题:Java Matrix4f.loadIdentity方法的具体用法?Java Matrix4f.loadIdentity怎么用?Java Matrix4f.loadIdentity使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.jme3.math.Matrix4f
的用法示例。
在下文中一共展示了Matrix4f.loadIdentity方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getOffsetTransform
import com.jme3.math.Matrix4f; //导入方法依赖的package包/类
/**
* Stores the skinning transform in the specified Matrix4f.
* The skinning transform applies the animation of the bone to a vertex.
* @param m
*/
void getOffsetTransform(Matrix4f m, Quaternion tmp1, Vector3f tmp2, Vector3f tmp3, Matrix3f rotMat) {
//Computing scale
Vector3f scale = worldScale.mult(worldBindInverseScale, tmp3);
//computing rotation
Quaternion rotate = worldRot.mult(worldBindInverseRot, tmp1);
//computing translation
//translation depend on rotation and scale
Vector3f translate = worldPos.add(rotate.mult(scale.mult(worldBindInversePos, tmp2), tmp2), tmp2);
//populating the matrix
m.loadIdentity();
m.setTransform(translate, scale, rotate.toRotationMatrix(rotMat));
}
示例2: computeWorldMatrix
import com.jme3.math.Matrix4f; //导入方法依赖的package包/类
/**
* Recomputes the matrix returned by {@link Geometry#getWorldMatrix() }.
* This will require a localized transform update for this geometry.
*/
public void computeWorldMatrix() {
// Force a local update of the geometry's transform
checkDoTransformUpdate();
// Compute the cached world matrix
cachedWorldMat.loadIdentity();
cachedWorldMat.setRotationQuaternion(worldTransform.getRotation());
cachedWorldMat.setTranslation(worldTransform.getTranslation());
TempVars vars = TempVars.get();
Matrix4f scaleMat = vars.tempMat4;
scaleMat.loadIdentity();
scaleMat.scale(worldTransform.getScale());
cachedWorldMat.multLocal(scaleMat);
vars.release();
}
示例3: computeOffsetTransform
import com.jme3.math.Matrix4f; //导入方法依赖的package包/类
/**
* Recomputes the matrix returned by {@link Geometry#getWorldMatrix() }.
* This will require a localized transform update for this geometry.
*/
public void computeOffsetTransform() {
// Compute the cached world matrix
cachedOffsetMat.loadIdentity();
cachedOffsetMat.setRotationQuaternion(prevLocalTransform.getRotation());
cachedOffsetMat.setTranslation(prevLocalTransform.getTranslation());
TempVars vars = TempVars.get();
Matrix4f scaleMat = vars.tempMat4;
scaleMat.loadIdentity();
scaleMat.scale(prevLocalTransform.getScale());
cachedOffsetMat.multLocal(scaleMat);
cachedOffsetMat.invertLocal();
tmpMat.loadIdentity();
tmpMat.setRotationQuaternion(localTransform.getRotation());
tmpMat.setTranslation(localTransform.getTranslation());
scaleMat.loadIdentity();
scaleMat.scale(localTransform.getScale());
tmpMat.multLocal(scaleMat);
tmpMat.mult(cachedOffsetMat,cachedOffsetMat);
vars.release();
}
示例4: getTransformMatrix
import com.jme3.math.Matrix4f; //导入方法依赖的package包/类
@Override
protected Matrix4f getTransformMatrix(Geometry g){
// Compute the Local matrix for the geometry
cachedLocalMat.loadIdentity();
cachedLocalMat.setRotationQuaternion(g.localTransform.getRotation());
cachedLocalMat.setTranslation(g.localTransform.getTranslation());
TempVars vars = TempVars.get();
Matrix4f scaleMat = vars.tempMat4;
scaleMat.loadIdentity();
scaleMat.scale(g.localTransform.getScale());
cachedLocalMat.multLocal(scaleMat);
vars.release();
return cachedLocalMat;
}