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


Java Matrix4f.loadIdentity方法代码示例

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

}
 
开发者ID:mleoking,项目名称:PhET,代码行数:23,代码来源:Bone.java

示例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();
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:21,代码来源:Geometry.java

示例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();
}
 
开发者ID:chototsu,项目名称:MikuMikuStudio,代码行数:31,代码来源:BatchedGeometry.java

示例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;
}
 
开发者ID:chototsu,项目名称:MikuMikuStudio,代码行数:16,代码来源:SimpleBatchNode.java


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