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

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

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

Mesh.getPatchVertexCount介绍

[英]Gets the amount of vertices used for each patch;
[中]获取每个面片使用的顶点数量;

代码示例

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

public void renderMesh(Mesh mesh, int lod, int count, VertexBuffer[] instanceData) {
    if (mesh.getVertexCount() == 0 || mesh.getTriangleCount() == 0 || count == 0) {
      return;
    }

    if (count > 1 && !caps.contains(Caps.MeshInstancing)) {
      throw new RendererException("Mesh instancing is not supported by the video hardware");
    }

    if (mesh.getLineWidth() != 1f && context.lineWidth != mesh.getLineWidth()) {
      gl.glLineWidth(mesh.getLineWidth());
      context.lineWidth = mesh.getLineWidth();
    }

    if (gl4 != null && mesh.getMode().equals(Mode.Patch)) {
      gl4.glPatchParameter(mesh.getPatchVertexCount());
    }
    statistics.onMeshDrawn(mesh, lod, count);
//        if (ctxCaps.GL_ARB_vertex_array_object){
//            renderMeshVertexArray(mesh, lod, count);
//        }else{
    renderMeshDefault(mesh, lod, count, instanceData);
//        }
  }

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

public void renderMesh(Mesh mesh, int lod, int count, VertexBuffer[] instanceData) {
    if (mesh.getVertexCount() == 0 || mesh.getTriangleCount() == 0 || count == 0) {
      return;
    }

    if (count > 1 && !caps.contains(Caps.MeshInstancing)) {
      throw new RendererException("Mesh instancing is not supported by the video hardware");
    }

    if (mesh.getLineWidth() != 1f && context.lineWidth != mesh.getLineWidth()) {
      gl.glLineWidth(mesh.getLineWidth());
      context.lineWidth = mesh.getLineWidth();
    }

    if (gl4 != null && mesh.getMode().equals(Mode.Patch)) {
      gl4.glPatchParameter(mesh.getPatchVertexCount());
    }
    statistics.onMeshDrawn(mesh, lod, count);
//        if (ctxCaps.GL_ARB_vertex_array_object){
//            renderMeshVertexArray(mesh, lod, count);
//        }else{
    renderMeshDefault(mesh, lod, count, instanceData);
//        }
  }

相关文章