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

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

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

Mesh.computeInstanceCount介绍

暂无

代码示例

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

/**
 * Update the {@link #getVertexCount() vertex} and
 * {@link #getTriangleCount() triangle} counts for this mesh
 * based on the current data. This method should be called
 * after the {@link Buffer#capacity() capacities} of the mesh's
 * {@link VertexBuffer vertex buffers} has been altered.
 *
 * @throws IllegalStateException If this mesh is in
 * {@link #setInterleaved() interleaved} format.
 */
public void updateCounts(){
  if (getBuffer(Type.InterleavedData) != null) {
    throw new IllegalStateException("Should update counts before interleave");
  }
  VertexBuffer pb = getBuffer(Type.Position);
  VertexBuffer ib = getBuffer(Type.Index);
  if (pb != null){
    vertCount = pb.getData().limit() / pb.getNumComponents();
  }
  if (ib != null){
    elementCount = computeNumElements(ib.getData().limit());
  }else{
    elementCount = computeNumElements(vertCount);
  }
  instanceCount = computeInstanceCount();
}

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

/**
 * Update the {@link #getVertexCount() vertex} and
 * {@link #getTriangleCount() triangle} counts for this mesh
 * based on the current data. This method should be called
 * after the {@link Buffer#capacity() capacities} of the mesh's
 * {@link VertexBuffer vertex buffers} has been altered.
 *
 * @throws IllegalStateException If this mesh is in
 * {@link #setInterleaved() interleaved} format.
 */
public void updateCounts(){
  if (getBuffer(Type.InterleavedData) != null)
    throw new IllegalStateException("Should update counts before interleave");
  VertexBuffer pb = getBuffer(Type.Position);
  VertexBuffer ib = getBuffer(Type.Index);
  if (pb != null){
    vertCount = pb.getData().limit() / pb.getNumComponents();
  }
  if (ib != null){
    elementCount = computeNumElements(ib.getData().limit());
  }else{
    elementCount = computeNumElements(vertCount);
  }
  instanceCount = computeInstanceCount();
}

相关文章