当前位置: 首页>>代码示例>>Java>>正文


Java Mesh.Mode方法代码示例

本文整理汇总了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);
    }
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:24,代码来源:LwjglRenderer.java

示例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);
    }
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:21,代码来源:LwjglGL1Renderer.java

示例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);
    }
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:9,代码来源:LwjglRenderer.java

示例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);
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:8,代码来源:LwjglGL1Renderer.java

示例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);
    }
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:41,代码来源:LwjglGL1Renderer.java

示例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);
}
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder,代码行数:65,代码来源:MeshPropertyBuilder.java

示例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);
 
开发者ID:mleoking,项目名称:PhET,代码行数:11,代码来源:MeshLayer.java


注:本文中的com.jme3.scene.Mesh.Mode方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。