本文整理了Java中com.jme3.scene.Geometry.getVertexCount()
方法的一些代码示例,展示了Geometry.getVertexCount()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Geometry.getVertexCount()
方法的具体详情如下:
包路径:com.jme3.scene.Geometry
类名称:Geometry
方法名:getVertexCount
[英]Returns this geometry's mesh vertex count.
[中]返回此几何体的网格顶点计数。
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
numOfVertices = g.getVertexCount();
for (int i = 0; i < lodLevels; i++) {
boolean isShortBuffer = g.getMesh().getLodLevel(i).getFormat() == VertexBuffer.Format.UnsignedShort;
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
protected void updateSubBatch(Geometry bg) {
Batch batch = batchesByGeom.get(bg);
if (batch != null) {
Mesh mesh = batch.geometry.getMesh();
Mesh origMesh = bg.getMesh();
VertexBuffer pvb = mesh.getBuffer(VertexBuffer.Type.Position);
VertexBuffer nvb = mesh.getBuffer(VertexBuffer.Type.Normal);
VertexBuffer tvb = mesh.getBuffer(VertexBuffer.Type.Tangent);
VertexBuffer opvb = origMesh.getBuffer(VertexBuffer.Type.Position);
VertexBuffer onvb = origMesh.getBuffer(VertexBuffer.Type.Normal);
VertexBuffer otvb = origMesh.getBuffer(VertexBuffer.Type.Tangent);
FloatBuffer posBuf = getFloatBuffer(pvb);
FloatBuffer normBuf = getFloatBuffer(nvb);
FloatBuffer tanBuf = getFloatBuffer(tvb);
FloatBuffer oposBuf = getFloatBuffer(opvb);
FloatBuffer onormBuf = getFloatBuffer(onvb);
FloatBuffer otanBuf = getFloatBuffer(otvb);
Matrix4f transformMat = getTransformMatrix(bg);
doTransforms(oposBuf, onormBuf, otanBuf, posBuf, normBuf, tanBuf, bg.startIndex, bg.startIndex + bg.getVertexCount(), transformMat);
pvb.updateData(posBuf);
if (nvb != null) {
nvb.updateData(normBuf);
}
if (tvb != null) {
tvb.updateData(tanBuf);
}
batch.geometry.updateModelBound();
}
}
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
float lineWidth = 1f;
for (Geometry geom : geometries) {
totalVerts += geom.getVertexCount();
totalTris += geom.getTriangleCount();
totalLodLevels = Math.min(totalLodLevels, geom.getMesh().getNumLodLevels());
if (maxVertCount < geom.getVertexCount()) {
maxVertCount = geom.getVertexCount();
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
ensureTmpArraysCapacity(geom.getVertexCount() * 3, targetNumBuffers);
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
totalVerts += geom.getVertexCount();
totalTris += geom.getTriangleCount();
totalLodLevels = Math.min(totalLodLevels, geom.getMesh().getNumLodLevels());
代码示例来源:origin: info.projectkyoto/mms-engine
protected BatchedGeometry(GeometryBatch batch, Geometry geom) {
this.batch = batch;
vertexCount = geom.getVertexCount();
triangleCount = geom.getTriangleCount();
name = geom.getName();
}
代码示例来源:origin: org.jmonkeyengine/jme3-core
protected void markSelected(Node n, boolean selected) {
ColorRGBA c = baseColor;
if (selected) {
c = selectedColor;
}
for (Spatial spatial : n.getChildren()) {
if (spatial instanceof Geometry) {
Geometry geom = (Geometry) spatial;
Geometry batch = (Geometry) getChild(getName() + "-batch0");
VertexBuffer vb = batch.getMesh().getBuffer(VertexBuffer.Type.Color);
FloatBuffer color = (FloatBuffer) vb.getData();
// System.err.println(getName() + "." + geom.getName() + " index " + getGeometryStartIndex(geom) * 4 + "/" + color.limit());
color.position(getGeometryStartIndex(geom) * 4);
for (int i = 0; i < geom.getVertexCount(); i++) {
color.put(c.r).put(c.g).put(c.b).put(c.a);
}
color.rewind();
vb.updateData(color);
}
}
}
}
代码示例来源:origin: info.projectkyoto/mms-engine
VertexBuffer otvb = origMesh.getBuffer(VertexBuffer.Type.Tangent);
FloatBuffer otanBuf = (FloatBuffer) otvb.getData();
doTransformsTangents(oposBuf, onormBuf, otanBuf, posBuf, normBuf, tanBuf, bg.startIndex, bg.startIndex + bg.getVertexCount(), transformMat);
tvb.updateData(tanBuf);
} else {
doTransforms(oposBuf, onormBuf, posBuf, normBuf, bg.startIndex, bg.startIndex + bg.getVertexCount(), transformMat);
代码示例来源:origin: org.jmonkeyengine/jme3-core
numOfVertices = g.getVertexCount();
for (int i = 0; i < lodLevels; i++) {
boolean isShortBuffer = g.getMesh().getLodLevel(i).getFormat() == VertexBuffer.Format.UnsignedShort;
代码示例来源:origin: info.projectkyoto/mms-engine
for (Geometry g : geometries) {
if (numOfVertices == 0) {
numOfVertices = g.getVertexCount();
代码示例来源:origin: org.jmonkeyengine/jme3-core
protected void updateSubBatch(Geometry bg) {
Batch batch = batchesByGeom.get(bg);
if (batch != null) {
Mesh mesh = batch.geometry.getMesh();
Mesh origMesh = bg.getMesh();
VertexBuffer pvb = mesh.getBuffer(VertexBuffer.Type.Position);
VertexBuffer nvb = mesh.getBuffer(VertexBuffer.Type.Normal);
VertexBuffer tvb = mesh.getBuffer(VertexBuffer.Type.Tangent);
VertexBuffer opvb = origMesh.getBuffer(VertexBuffer.Type.Position);
VertexBuffer onvb = origMesh.getBuffer(VertexBuffer.Type.Normal);
VertexBuffer otvb = origMesh.getBuffer(VertexBuffer.Type.Tangent);
FloatBuffer posBuf = getFloatBuffer(pvb);
FloatBuffer normBuf = getFloatBuffer(nvb);
FloatBuffer tanBuf = getFloatBuffer(tvb);
FloatBuffer oposBuf = getFloatBuffer(opvb);
FloatBuffer onormBuf = getFloatBuffer(onvb);
FloatBuffer otanBuf = getFloatBuffer(otvb);
Matrix4f transformMat = getTransformMatrix(bg);
doTransforms(oposBuf, onormBuf, otanBuf, posBuf, normBuf, tanBuf, bg.startIndex, bg.startIndex + bg.getVertexCount(), transformMat);
pvb.updateData(posBuf);
if (nvb != null) {
nvb.updateData(normBuf);
}
if (tvb != null) {
tvb.updateData(tanBuf);
}
batch.geometry.updateModelBound();
}
}
代码示例来源:origin: info.projectkyoto/mms-engine
totalVerts += geom.getVertexCount();
totalTris += geom.getTriangleCount();
totalLodLevels = Math.min(totalLodLevels, geom.getMesh().getNumLodLevels());
if (maxVertCount < geom.getVertexCount()) {
maxVertCount = geom.getVertexCount();
代码示例来源:origin: org.jmonkeyengine/jme3-core
float lineWidth = 1f;
for (Geometry geom : geometries) {
totalVerts += geom.getVertexCount();
totalTris += geom.getTriangleCount();
totalLodLevels = Math.min(totalLodLevels, geom.getMesh().getNumLodLevels());
if (maxVertCount < geom.getVertexCount()) {
maxVertCount = geom.getVertexCount();
代码示例来源:origin: info.projectkyoto/mms-engine
totalVerts += geom.getVertexCount();
totalTris += geom.getTriangleCount();
totalLodLevels = Math.min(totalLodLevels, geom.getMesh().getNumLodLevels());
代码示例来源:origin: info.projectkyoto/mms-engine
totalVerts += geom.getVertexCount();
totalTris += geom.getTriangleCount();
totalLodLevels = Math.min(totalLodLevels, geom.getMesh().getNumLodLevels());
代码示例来源:origin: org.jmonkeyengine/jme3-core
totalVerts += geom.getVertexCount();
totalTris += geom.getTriangleCount();
totalLodLevels = Math.min(totalLodLevels, geom.getMesh().getNumLodLevels());
内容来源于网络,如有侵权,请联系作者删除!