本文整理汇总了Java中com.jme3.scene.VertexBuffer.getElementComponent方法的典型用法代码示例。如果您正苦于以下问题:Java VertexBuffer.getElementComponent方法的具体用法?Java VertexBuffer.getElementComponent怎么用?Java VertexBuffer.getElementComponent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.jme3.scene.VertexBuffer
的用法示例。
在下文中一共展示了VertexBuffer.getElementComponent方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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("------");
}
}
示例2: 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));
}
示例3: getVector2f
import com.jme3.scene.VertexBuffer; //导入方法依赖的package包/类
public static Vector2f getVector2f(VertexBuffer v,int id){
return new Vector2f((float)v.getElementComponent(id, 0),
(float)v.getElementComponent(id, 1));
}