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

x33g5p2x  于2022-01-20 转载在 其他  
字(1.4k)|赞(0)|评价(0)|浏览(115)

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

Geometry.addMatParamOverride介绍

暂无

代码示例

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

private void inputMpo(MatParamOverride... overrides) {
  if (evaluated) {
    throw new IllegalStateException();
  }
  for (MatParamOverride override : overrides) {
    geometry.addMatParamOverride(override);
  }
  root.updateGeometricState();
}

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

@Override
  public void visit(Geometry geom) {
    MatParam p = geom.getMaterial().getMaterialDef().getMaterialParam("MorphWeights");
    if (p == null) {
      return;
    }
    Mesh mesh = geom.getMesh();
    if (mesh != null && mesh.hasMorphTargets()) {
      targets.add(geom);
      // If the mesh is in a subgraph of a node with a SkinningControl it might have hardware skinning activated through mat param override even if it's not skinned.
      // this code makes sure that if the mesh has no hardware skinning buffers hardware skinning won't be activated.
      // this is important, because if HW skinning is activated the shader will declare 2 additional useless attributes,
      // and we desperately need all the attributes we can find for Morph animation.
      if (mesh.getBuffer(VertexBuffer.Type.HWBoneIndex) == null && !geom.getLocalMatParamOverrides().contains(nullNumberOfBones)) {
        geom.addMatParamOverride(nullNumberOfBones);
      }
    }
  }
}

相关文章