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

x33g5p2x  于2022-01-25 转载在 其他  
字(2.0k)|赞(0)|评价(0)|浏览(92)

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

Mesh.cloneForAnim介绍

[英]Clone the mesh for animation use. This creates a shallow clone of the mesh, sharing most of the VertexBuffer data, however the Type#Position, Type#Normal, and Type#Tangent buffers are deeply cloned.
[中]克隆网格以供动画使用。这将创建网格的浅克隆,共享大部分顶点缓冲区数据,但类型#位置、类型#法线和类型#切线缓冲区将被深度克隆。

代码示例

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

this.mesh = mesh.cloneForAnim();
} else {

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

/**
 *  The old clone() method that did not use the new Cloner utility.
 */
@Override
public Geometry oldClone(boolean cloneMaterial) {
  Geometry geomClone = (Geometry) super.clone(cloneMaterial);
  // This geometry is managed,
  // but the cloned one is not attached to anything, hence not managed.
  if (geomClone.isGrouped()) {
    geomClone.groupNode = null;
    geomClone.startIndex = -1;
  }
  geomClone.cachedWorldMat = cachedWorldMat.clone();
  if (material != null) {
    if (cloneMaterial) {
      geomClone.material = material.clone();
    } else {
      geomClone.material = material;
    }
  }
  if (mesh != null && mesh.getBuffer(Type.BindPosePosition) != null) {
    geomClone.mesh = mesh.cloneForAnim();
  }
  return geomClone;
}

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

/**
 * This version of clone is a shallow clone, in other words, the
 * same mesh is referenced as the original geometry.
 * Exception: if the mesh is marked as being a software
 * animated mesh, (bind pose is set) then the positions
 * and normals are deep copied.
 */
@Override
public Geometry clone(boolean cloneMaterial) {
  Geometry geomClone = (Geometry) super.clone(cloneMaterial);
  //this geometry is batched but the clonned one should not be
  if (isBatched()) {
    geomClone.batchNode = null;
    geomClone.unBatch();
  }
  geomClone.cachedWorldMat = cachedWorldMat.clone();
  if (material != null) {
    if (cloneMaterial) {
      geomClone.material = material.clone();
    } else {
      geomClone.material = material;
    }
  }
  if (mesh != null && mesh.getBuffer(Type.BindPosePosition) != null) {
    geomClone.mesh = mesh.cloneForAnim();
  }
  return geomClone;
}

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

this.mesh = mesh.cloneForAnim();
} else {

相关文章