本文整理了Java中com.jme3.scene.Mesh.getLodLevel()
方法的一些代码示例,展示了Mesh.getLodLevel()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Mesh.getLodLevel()
方法的具体详情如下:
包路径:com.jme3.scene.Mesh
类名称:Mesh
方法名:getLodLevel
[英]Returns the lod level at the given index.
[中]返回给定索引处的lod级别。
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
private int computeNbTri() {
int nbTri = 0;
for (Geometry geometry : listGeoms) {
if (geometry.getMesh().getNumLodLevels() > 0) {
nbTri += geometry.getMesh().getLodLevel(lodLevel).getNumElements();
} else {
nbTri += geometry.getMesh().getTriangleCount();
}
}
return nbTri;
}
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
lodSize[i] += g.getMesh().getLodLevel(i).getData().limit();
numOfVertices = g.getVertexCount();
for (int i = 0; i < lodLevels; i++) {
boolean isShortBuffer = g.getMesh().getLodLevel(i).getFormat() == VertexBuffer.Format.UnsignedShort;
if(isShortBuffer){
ShortBuffer buffer = (ShortBuffer) g.getMesh().getLodLevel(i).getDataReadOnly();
for (int j = 0; j < buffer.limit(); j++) {
lodData[i][bufferPos[i]] = (buffer.get()& 0xffff) + indexPos[i];
IntBuffer buffer = (IntBuffer) g.getMesh().getLodLevel(i).getDataReadOnly();
for (int j = 0; j < buffer.limit(); j++) {
lodData[i][bufferPos[i]] = buffer.get() + indexPos[i];
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
private void renderMeshVertexArray(Mesh mesh, int lod, int count, VertexBuffer instanceData) {
if (mesh.getId() == -1) {
updateVertexArray(mesh, instanceData);
} else {
// TODO: Check if it was updated
}
if (context.boundVertexArray != mesh.getId()) {
gl3.glBindVertexArray(mesh.getId());
context.boundVertexArray = mesh.getId();
}
// IntMap<VertexBuffer> buffers = mesh.getBuffers();
VertexBuffer indices;
if (mesh.getNumLodLevels() > 0) {
indices = mesh.getLodLevel(lod);
} else {
indices = mesh.getBuffer(Type.Index);
}
if (indices != null) {
drawTriangleList(indices, mesh, count);
} else {
drawTriangleArray(mesh.getMode(), count, mesh.getVertexCount());
}
clearVertexAttribs();
}
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
indices = mesh.getLodLevel(lod);
} else {
indices = mesh.getBuffer(Type.Index);
代码示例来源:origin: org.jmonkeyengine/jme3-core
lodSize[i] += g.getMesh().getLodLevel(i).getData().limit();
numOfVertices = g.getVertexCount();
for (int i = 0; i < lodLevels; i++) {
boolean isShortBuffer = g.getMesh().getLodLevel(i).getFormat() == VertexBuffer.Format.UnsignedShort;
if(isShortBuffer){
ShortBuffer buffer = (ShortBuffer) g.getMesh().getLodLevel(i).getDataReadOnly();
for (int j = 0; j < buffer.limit(); j++) {
lodData[i][bufferPos[i]] = (buffer.get()& 0xffff) + indexPos[i];
IntBuffer buffer = (IntBuffer) g.getMesh().getLodLevel(i).getDataReadOnly();
for (int j = 0; j < buffer.limit(); j++) {
lodData[i][bufferPos[i]] = buffer.get() + indexPos[i];
代码示例来源:origin: info.projectkyoto/mms-engine
lodSize[i] += g.getMesh().getLodLevel(i).getData().capacity();
ShortBuffer buffer = (ShortBuffer) g.getMesh().getLodLevel(i).getData();
buffer.rewind();
代码示例来源:origin: org.jmonkeyengine/jme3-core
private void renderMeshVertexArray(Mesh mesh, int lod, int count, VertexBuffer instanceData) {
if (mesh.getId() == -1) {
updateVertexArray(mesh, instanceData);
} else {
// TODO: Check if it was updated
}
if (context.boundVertexArray != mesh.getId()) {
gl3.glBindVertexArray(mesh.getId());
context.boundVertexArray = mesh.getId();
}
// IntMap<VertexBuffer> buffers = mesh.getBuffers();
VertexBuffer indices;
if (mesh.getNumLodLevels() > 0) {
indices = mesh.getLodLevel(lod);
} else {
indices = mesh.getBuffer(Type.Index);
}
if (indices != null) {
drawTriangleList(indices, mesh, count);
} else {
drawTriangleArray(mesh.getMode(), count, mesh.getVertexCount());
}
clearVertexAttribs();
}
代码示例来源:origin: us.ihmc.thirdparty.jme/jme3-lwjgl
private void renderMeshVertexArray(Mesh mesh, int lod, int count, VertexBuffer instanceData) {
if (mesh.getId() == -1) {
updateVertexArray(mesh, instanceData);
} else {
// TODO: Check if it was updated
}
if (context.boundVertexArray != mesh.getId()) {
glBindVertexArray(mesh.getId());
context.boundVertexArray = mesh.getId();
}
// IntMap<VertexBuffer> buffers = mesh.getBuffers();
VertexBuffer indices;
if (mesh.getNumLodLevels() > 0) {
indices = mesh.getLodLevel(lod);
} else {
indices = mesh.getBuffer(Type.Index);
}
if (indices != null) {
drawTriangleList(indices, mesh, count);
} else {
drawTriangleArray(mesh.getMode(), count, mesh.getVertexCount());
}
clearVertexAttribs();
clearTextureUnits();
}
代码示例来源:origin: org.jmonkeyengine/jme3-core
indices = mesh.getLodLevel(lod);
} else {
indices = mesh.getBuffer(Type.Index);
代码示例来源:origin: us.ihmc.thirdparty.jme/jme3-lwjgl
indices = mesh.getLodLevel(lod);
} else {
indices = mesh.getBuffer(Type.Index);
内容来源于网络,如有侵权,请联系作者删除!