com.jme3.scene.Spatial.setLocalTransform()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(3.3k)|赞(0)|评价(0)|浏览(86)

本文整理了Java中com.jme3.scene.Spatial.setLocalTransform()方法的一些代码示例,展示了Spatial.setLocalTransform()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Spatial.setLocalTransform()方法的具体详情如下:
包路径:com.jme3.scene.Spatial
类名称:Spatial
方法名:setLocalTransform

Spatial.setLocalTransform介绍

[英]setLocalTransform sets the local transform of this spatial.
[中]setLocalTransform设置此空间的局部变换。

代码示例

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

/**
 * Resets the node's feature to its starting transformation.
 */
private void reset() {
  if (spatial != null) {
    spatial.setLocalTransform(spatialStartTransform);
    for (SimulationNode child : children) {
      child.reset();
    }
  } else if (skeleton != null) {
    for (Entry<Bone, Transform> entry : boneStartTransforms.entrySet()) {
      Transform t = entry.getValue();
      entry.getKey().setBindTransforms(t.getTranslation(), t.getRotation(), t.getScale());
      entry.getKey().updateModelTransforms();
    }
    skeleton.reset();
  }
}

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

private static void relocateSpatial(Spatial spatial, 
                  Transform originalWorldTransform, Transform newWorldTransform) {
  Transform localTransform = new Transform();
  localTransform.set(originalWorldTransform);
  localTransform.combineWithParent(newWorldTransform.invert());
  spatial.setLocalTransform(localTransform);
}

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

spatial.setLocalTransform(jmeLocalNodeTransform);

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

spatial.setLocalTransform(readTransforms(nodeData));

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

case CONSTRAINT_SPACE_WORLD:
  if (feature.getParent() == null) {
    feature.setLocalTransform(transform);
  } else {
    Transform parentWorldTransform = feature.getParent().getWorldTransform();
    transform.setScale(m.toScaleVector());
    feature.setLocalTransform(transform);

代码示例来源:origin: org.jmonkeyengine/jme3-plugins

private static void relocateSpatial(Spatial spatial, 
                  Transform originalWorldTransform, Transform newWorldTransform) {
  Transform localTransform = new Transform();
  localTransform.set(originalWorldTransform);
  localTransform.combineWithParent(newWorldTransform.invert());
  spatial.setLocalTransform(localTransform);
}

代码示例来源:origin: org.jmonkeyengine/jme3-plugins

spatial.setLocalTransform(jmeLocalNodeTransform);

代码示例来源:origin: org.jmonkeyengine/jme3-plugins

spatial.setLocalTransform(readTransforms(nodeData));

代码示例来源:origin: info.projectkyoto/mms-engine

@Override
  protected void controlUpdate(float tpf) {
    for (int i = 0; i < boneMarkArray.length; i++) {
      Matrix4f m = skeletonControl.getOffsetMatrices()[i].clone();
      PMDBone bone = boneArray[i];
//            if (bone.getBoneName().equals("右腕")) {
      //            Matrix4f m2 = boneMarkArray[i].getLocalToWorldMatrix(new Matrix4f()).clone();
      //            m.invertLocal();
      //            m.loadIdentity();
      Vector3f bonePos = new Vector3f(bone.getBoneHeadPos().x,
          bone.getBoneHeadPos().y,
          bone.getBoneHeadPos().z);
//                System.out.println("projectionMatrix = "+projectionMatrix);
//                System.out.println("bonePos1 = "+bonePos);
      m.mult(bonePos, bonePos);
//                System.out.println("bonePos2 = "+bonePos);
      Transform t = new Transform(m.toTranslationVector());
      cam.getScreenCoordinates(bonePos, bonePos);
//                System.out.println("bonePos3 = "+bonePos);
      t.setTranslation(bonePos);
      boneMarkArray[i].setLocalTransform(t);
//            }            
//            System.out.println("m2 = "+m2);
    }
  }

代码示例来源:origin: us.ihmc/ihmc-jmonkey-engine-toolkit

subchild.setLocalTransform(child.getLocalTransform());

代码示例来源:origin: us.ihmc/IHMCJMonkeyEngineToolkit

subchild.setLocalTransform(child.getLocalTransform());

相关文章

Spatial类方法