本文整理汇总了Java中com.jme3.scene.Mesh.Mode方法的典型用法代码示例。如果您正苦于以下问题:Java Mesh.Mode方法的具体用法?Java Mesh.Mode怎么用?Java Mesh.Mode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.jme3.scene.Mesh
的用法示例。
在下文中一共展示了Mesh.Mode方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: convertElementMode
import com.jme3.scene.Mesh; //导入方法依赖的package包/类
/*********************************************************************\
|* Render Calls *|
\*********************************************************************/
public int convertElementMode(Mesh.Mode mode) {
switch (mode) {
case Points:
return GL_POINTS;
case Lines:
return GL_LINES;
case LineLoop:
return GL_LINE_LOOP;
case LineStrip:
return GL_LINE_STRIP;
case Triangles:
return GL_TRIANGLES;
case TriangleFan:
return GL_TRIANGLE_FAN;
case TriangleStrip:
return GL_TRIANGLE_STRIP;
default:
throw new UnsupportedOperationException("Unrecognized mesh mode: " + mode);
}
}
示例2: convertElementMode
import com.jme3.scene.Mesh; //导入方法依赖的package包/类
private int convertElementMode(Mesh.Mode mode) {
switch (mode) {
case Points:
return GL_POINTS;
case Lines:
return GL_LINES;
case LineLoop:
return GL_LINE_LOOP;
case LineStrip:
return GL_LINE_STRIP;
case Triangles:
return GL_TRIANGLES;
case TriangleFan:
return GL_TRIANGLE_FAN;
case TriangleStrip:
return GL_TRIANGLE_STRIP;
default:
throw new UnsupportedOperationException("Unrecognized mesh mode: " + mode);
}
}
示例3: drawTriangleArray
import com.jme3.scene.Mesh; //导入方法依赖的package包/类
public void drawTriangleArray(Mesh.Mode mode, int count, int vertCount) {
if (count > 1) {
ARBDrawInstanced.glDrawArraysInstancedARB(convertElementMode(mode), 0,
vertCount, count);
} else {
glDrawArrays(convertElementMode(mode), 0, vertCount);
}
}
示例4: drawTriangleArray
import com.jme3.scene.Mesh; //导入方法依赖的package包/类
public void drawTriangleArray(Mesh.Mode mode, int count, int vertCount) {
if (count > 1) {
throw new UnsupportedOperationException();
}
glDrawArrays(convertElementMode(mode), 0, vertCount);
}
示例5: drawTriangleList
import com.jme3.scene.Mesh; //导入方法依赖的package包/类
public void drawTriangleList(VertexBuffer indexBuf, Mesh mesh, int count) {
Mesh.Mode mode = mesh.getMode();
Buffer indexData = indexBuf.getData();
indexData.rewind();
if (mesh.getMode() == Mode.Hybrid) {
throw new UnsupportedOperationException();
/*
int[] modeStart = mesh.getModeStart();
int[] elementLengths = mesh.getElementLengths();
int elMode = convertElementMode(Mode.Triangles);
int fmt = convertVertexFormat(indexBuf.getFormat());
// int elSize = indexBuf.getFormat().getComponentSize();
// int listStart = modeStart[0];
int stripStart = modeStart[1];
int fanStart = modeStart[2];
int curOffset = 0;
for (int i = 0; i < elementLengths.length; i++) {
if (i == stripStart) {
elMode = convertElementMode(Mode.TriangleStrip);
} else if (i == fanStart) {
elMode = convertElementMode(Mode.TriangleStrip);
}
int elementLength = elementLengths[i];
indexData.position(curOffset);
drawElements(elMode,
fmt,
indexData);
curOffset += elementLength;
}*/
} else {
drawElements(convertElementMode(mode),
convertVertexFormat(indexBuf.getFormat()),
indexData);
}
}
示例6: buildForImpl
import com.jme3.scene.Mesh; //导入方法依赖的package包/类
@Override
@FXThread
protected void buildForImpl(@NotNull final Object object, @Nullable final Object parent, @NotNull final VBox container,
@NotNull final ModelChangeConsumer changeConsumer) {
if (!(object instanceof Mesh)) return;
final Mesh mesh = (Mesh) object;
final Mesh.Mode mode = mesh.getMode();
final int id = mesh.getId();
final int instanceCount = mesh.getInstanceCount();
final int vertexCount = mesh.getVertexCount();
final int numLodLevels = mesh.getNumLodLevels();
final int triangleCount = mesh.getTriangleCount();
final DefaultSinglePropertyControl<ModelChangeConsumer, Mesh, Integer> idControl =
new DefaultSinglePropertyControl<>(id, Messages.MODEL_PROPERTY_ID, changeConsumer);
idControl.setSyncHandler(Mesh::getId);
idControl.setToStringFunction(value -> Integer.toString(value));
idControl.setEditObject(mesh);
final DefaultSinglePropertyControl<ModelChangeConsumer, Mesh, Integer> instanceCountControl =
new DefaultSinglePropertyControl<>(instanceCount, Messages.MODEL_PROPERTY_INSTANCE_COUNT, changeConsumer);
instanceCountControl.setSyncHandler(Mesh::getInstanceCount);
instanceCountControl.setToStringFunction(value -> Integer.toString(value));
instanceCountControl.setEditObject(mesh);
final DefaultSinglePropertyControl<ModelChangeConsumer, Mesh, Integer> vertexCountControl =
new DefaultSinglePropertyControl<>(vertexCount, Messages.MODEL_PROPERTY_VERTEX_COUNT, changeConsumer);
vertexCountControl.setSyncHandler(Mesh::getVertexCount);
vertexCountControl.setToStringFunction(value -> Integer.toString(value));
vertexCountControl.setEditObject(mesh);
final DefaultSinglePropertyControl<ModelChangeConsumer, Mesh, Integer> triangleCountControl =
new DefaultSinglePropertyControl<>(triangleCount, Messages.MODEL_PROPERTY_TRIANGLE_COUNT, changeConsumer);
triangleCountControl.setSyncHandler(Mesh::getTriangleCount);
triangleCountControl.setToStringFunction(value -> Integer.toString(value));
triangleCountControl.setEditObject(mesh);
final DefaultSinglePropertyControl<ModelChangeConsumer, Mesh, Integer> numLodLevelsControl =
new DefaultSinglePropertyControl<>(numLodLevels, Messages.MODEL_PROPERTY_NUM_LOD_LEVELS, changeConsumer);
numLodLevelsControl.setSyncHandler(Mesh::getNumLodLevels);
numLodLevelsControl.setToStringFunction(value -> Integer.toString(value));
numLodLevelsControl.setEditObject(mesh);
final EnumPropertyControl<ModelChangeConsumer, Mesh, Mesh.Mode> modeControl =
new EnumPropertyControl<>(mode, Messages.MODEL_PROPERTY_MODE, changeConsumer, MODES);
modeControl.setApplyHandler(Mesh::setMode);
modeControl.setSyncHandler(Mesh::getMode);
modeControl.setEditObject(mesh);
FXUtils.addToPane(idControl, container);
FXUtils.addToPane(instanceCountControl, container);
FXUtils.addToPane(vertexCountControl, container);
FXUtils.addToPane(triangleCountControl, container);
FXUtils.addToPane(numLodLevelsControl, container);
FXUtils.addToPane(modeControl, container);
}
示例7: drawTriangleList
import com.jme3.scene.Mesh; //导入方法依赖的package包/类
/**
* Draws the list of triangles given in the index buffer.
* Each triangle is composed of 3 indices to a vertex, the attribs of which
* are supplied using <code>setVertexAttrib</code>.
* The int variable gl_VertexID can be used to access the current
* vertex index inside the vertex shader.
*
* @param count The number of instances to draw
*/
public void drawTriangleList(VertexBuffer indexBuf, Mesh.Mode mode, int count, int vertCount);