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


Java VertexBuffer.getNumElements方法代码示例

本文整理汇总了Java中com.jme3.scene.VertexBuffer.getNumElements方法的典型用法代码示例。如果您正苦于以下问题:Java VertexBuffer.getNumElements方法的具体用法?Java VertexBuffer.getNumElements怎么用?Java VertexBuffer.getNumElements使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.jme3.scene.VertexBuffer的用法示例。


在下文中一共展示了VertexBuffer.getNumElements方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: updateItem

import com.jme3.scene.VertexBuffer; //导入方法依赖的package包/类
@Override
protected void updateItem(@Nullable final Integer level, final boolean empty) {
    super.updateItem(level, empty);

    final Geometry geometry = getEditObject();
    final Mesh mesh = geometry.getMesh();

    if (level == null || mesh == null) {
        setText("None");
        return;
    }

    int elements;

    if (level < mesh.getNumLodLevels()) {
        final VertexBuffer lodLevel = mesh.getLodLevel(level);
        elements = lodLevel.getNumElements();
    } else {
        elements = mesh.getTriangleCount();
    }

    setText(Messages.MODEL_PROPERTY_LEVEL + ": " + level + " (" + elements + " " +
            Messages.MODEL_PROPERTY_TRIANGLE_COUNT + ")");
}
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder,代码行数:25,代码来源:LodLevelPropertyControl.java

示例2: printMesh

import com.jme3.scene.VertexBuffer; //导入方法依赖的package包/类
public static void printMesh(Mesh mesh) {
    for (int bufType = 0; bufType < Type.values().length; bufType++) {
        VertexBuffer outBuf = mesh.getBuffer(Type.values()[bufType]);
        if (outBuf == null) {
            continue;
        }

        System.out.println(outBuf.getBufferType() + ": ");
        for (int vert = 0; vert < outBuf.getNumElements(); vert++) {
            String str = "[";
            for (int comp = 0; comp < outBuf.getNumComponents(); comp++) {
                Object val = outBuf.getElementComponent(vert, comp);
                outBuf.setElementComponent(vert, comp, val);
                val = outBuf.getElementComponent(vert, comp);
                str += val;
                if (comp != outBuf.getNumComponents() - 1) {
                    str += ", ";
                }
            }
            str += "]";
            System.out.println(str);
        }
        System.out.println("------");
    }
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:26,代码来源:GeometryBatchFactory.java

示例3: getVector3f

import com.jme3.scene.VertexBuffer; //导入方法依赖的package包/类
public static Vector3f getVector3f(VertexBuffer v,int id){
	if(v==null||v.getNumElements()<=id){
		return new Vector3f();
	}
	
	return new Vector3f((float)v.getElementComponent(id, 0),
	(float)v.getElementComponent(id, 1),
	(float)v.getElementComponent(id, 2));
	
}
 
开发者ID:riccardobl,项目名称:JMELink-SP,代码行数:11,代码来源:OBJMesh.java

示例4: SharedBuffer

import com.jme3.scene.VertexBuffer; //导入方法依赖的package包/类
/**
 * Creates a shared buffer from the specified vertex buffer
 * @param vertexBuffer the vertex buffer to use
 */
public SharedBuffer(VertexBuffer vertexBuffer) {
	this.jmeBuffer = vertexBuffer;
	this.format = vertexBuffer.getFormat();
	this.type = vertexBuffer.getBufferType();
	this.components = vertexBuffer.getNumComponents();
	this.size = vertexBuffer.getNumElements();
}
 
开发者ID:shamanDevel,项目名称:jME3-OpenCL-Library,代码行数:12,代码来源:SharedBuffer.java

示例5: getVertices

import com.jme3.scene.VertexBuffer; //导入方法依赖的package包/类
/**
 * Get vertcices of mesh.
 *
 * @param mesh
 * @return
 */
public static Vector3f[] getVertices(Mesh mesh) {
    VertexBuffer buffer = mesh.getBuffer(VertexBuffer.Type.Position);
    Vector3f[] array = new Vector3f[buffer.getNumElements()];
    for (int i = 0; i < buffer.getNumElements(); i++) {
        array[i] = new Vector3f();
        array[i].setX((Float) buffer.getElementComponent(i, 0));
        array[i].setY((Float) buffer.getElementComponent(i, 1));
        array[i].setZ((Float) buffer.getElementComponent(i, 2));
    }
    return array;
}
 
开发者ID:QuietOne,项目名称:jNavigation,代码行数:18,代码来源:GraphicHelper.java


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