com.jme3.scene.Mesh.getBufferList()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(6.5k)|赞(0)|评价(0)|浏览(152)

本文整理了Java中com.jme3.scene.Mesh.getBufferList()方法的一些代码示例,展示了Mesh.getBufferList()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Mesh.getBufferList()方法的具体详情如下:
包路径:com.jme3.scene.Mesh
类名称:Mesh
方法名:getBufferList

Mesh.getBufferList介绍

[英]Returns a list of all VertexBuffer on this Mesh. Using a list instead an IntMap via the #getBuffers() method is better for iteration as there's no need to create an iterator instance. Note that the returned list is a reference to the list used internally, modifying it will cause undefined results.
[中]返回此网格上所有VertexBuffer的列表。通过#getBuffers()方法使用列表代替IntMap更适合迭代,因为不需要创建迭代器实例。请注意,返回的列表是对内部使用的列表的引用,修改它将导致未定义的结果。

代码示例

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

|| qName.equals("sharedgeometry")) {
for (VertexBuffer buf : mesh.getBufferList().getArray()) {
  Buffer data = buf.getData();
  if (data.position() != 0) {

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

public static void dumpMesh(Mesh m) {
  for (VertexBuffer vertexBuffer : m.getBufferList().getArray()) {
    System.err.println(vertexBuffer.getBufferType());
    System.err.println(vertexBuffer.getFormat());

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

Map<VertexBuffer.Type, Integer> typesCount = new EnumMap<VertexBuffer.Type, Integer>(VertexBuffer.Type.class);
for (Geometry geom : geoms) {
  for (VertexBuffer buffer : geom.getMesh().getBufferList()) {
    if (types.get(buffer.getBufferType()) == null) {
      types.put(buffer.getBufferType(), buffer);
    for (Geometry geom : geoms) {
      for (VertexBuffer buffer : geom.getMesh().getBufferList()) {
        Integer count = typesCount.get(buffer.getBufferType());
        if (count != null && count < geoms.size()) {

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

mesh.getBufferList().remove(vertexBuffer);
mesh.getBuffers().remove(bufferType.ordinal());

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

/**
 * Computes the number of remaining buffers on this mesh.
 * This is supposed to give a hint on how many attributes will be used in the material and computes the remaining available slots for the morph attributes.
 * However, the shader can declare attributes that are not used and not bound to a real buffer.
 * That's why we attempt to compile the shader later on to avoid any compilation crash.
 * This method is here to avoid too much render test iteration.
 *
 * @param mesh
 * @param renderer
 * @return
 */
private int getRemainingBuffers(Mesh mesh, Renderer renderer) {
  int nbUsedBuffers = 0;
  for (VertexBuffer vb : mesh.getBufferList().getArray()) {
    boolean isMorphBuffer = vb.getBufferType().ordinal() >= VertexBuffer.Type.MorphTarget0.ordinal() && vb.getBufferType().ordinal() <= VertexBuffer.Type.MorphTarget9.ordinal();
    if (vb.getBufferType() == VertexBuffer.Type.Index || isMorphBuffer) continue;
    if (vb.getUsage() != VertexBuffer.Usage.CpuOnly) {
      nbUsedBuffers++;
    }
  }
  return renderer.getLimits().get(Limits.VertexAttributes) - nbUsedBuffers;
}

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

&& mesh.getVertexCount() != 0
  && mesh.getTriangleCount() != 0) {
for (VertexBuffer vb : mesh.getBufferList().getArray()) {
  if (vb.getData() != null && vb.getUsage() != VertexBuffer.Usage.CpuOnly) {
    renderer.updateBufferData(vb);

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

for (VertexBuffer vb : mesh.getBufferList().getArray()) {
  if (vb.getBufferType() == Type.InterleavedData

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

for (VertexBuffer vb : mesh.getBufferList().getArray()) {
  if (vb.getBufferType() == Type.InterleavedData

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

SafeArrayList<VertexBuffer> oldVertexData = other.getBufferList();
for (VertexBuffer oldVb : oldVertexData) {
  if (oldVb.getBufferType() == VertexBuffer.Type.Index) {

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

for (VertexBuffer vb : geom.getMesh().getBufferList().getArray()) {
  int currentCompsForBuf = compsForBuf[vb.getBufferType().ordinal()];
  if (vb.getBufferType() != VertexBuffer.Type.Index && currentCompsForBuf != 0 && currentCompsForBuf != vb.getNumComponents()) {

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

for (VertexBuffer vb : geom.getMesh().getBufferList().getArray()) {
  int currentCompsForBuf = compsForBuf[vb.getBufferType().ordinal()];
  if (vb.getBufferType() != Type.Index && currentCompsForBuf != 0 && currentCompsForBuf != vb.getNumComponents()) {

代码示例来源:origin: info.projectkyoto/mms-engine

public void optimize2() {
  for(Mesh mesh : meshSet) {
    mesh.setInterleaved();
    for(VertexBuffer vb : mesh.getBufferList()) {
      System.out.println(
          "type = "+vb.getBufferType()
          + "stride = "+vb.getStride()
          + "offset "+vb.getOffset()
          );
      
    }
    System.out.println("done");
  }
}
String createVBKey(VertexBuffer vb) {

代码示例来源:origin: info.projectkyoto/mms-engine

public void optimize3() {
    HashMap<String, VertexBuffer>vbMap = new HashMap<String, VertexBuffer>();
    ArrayList<VertexBuffer> vbList = new ArrayList<VertexBuffer>();
    for(Mesh mesh : meshSet) {
      vbList.clear();
      for(VertexBuffer vb : mesh.getBufferList()) {
        if (vb.getBufferType().equals(VertexBuffer.Type.Index)
            || vb.getBufferType().equals(VertexBuffer.Type.InterleavedData)){
          continue;
        }
        if (vb.getStride() > 0) {
          String key = createVBKey(vb);
          System.out.append("key = "+key);
          VertexBuffer vb2 = vbMap.get(key);
          if (vb2 != null) {
            vbList.add(vb2);
          } else {
            vbMap.put(key, vb);
          }
        }
      }
      for(VertexBuffer vb : vbList) {
//                mesh.setBuffer(vb);
      }
    }
  }
  public void optimize() {

代码示例来源:origin: org.jmonkeyengine/jme3-plugins

public static void dumpMesh(Mesh m) {
  for (VertexBuffer vertexBuffer : m.getBufferList().getArray()) {
    System.err.println(vertexBuffer.getBufferType());
    System.err.println(vertexBuffer.getFormat());

代码示例来源:origin: info.projectkyoto/mms-engine

int calcInterleavedSize() {
    interleavedSize = 0;
    for(Mesh mesh : meshSet) {
      for(VertexBuffer vb : mesh.getBufferList()) {
        if (vb.getBufferType().equals(VertexBuffer.Type.Index)
            || vb.getBufferType().equals(VertexBuffer.Type.InterleavedData)){
          continue;
        }
        int limit = vb.getData().capacity();
//                interleavedSize += vb.getComponentsLength() * vb.get
        interleavedSize += limit * vb.getFormat().getComponentSize();
      }
    }
    return interleavedSize;
  }
}

代码示例来源:origin: org.jmonkeyengine/jme3-core

&& mesh.getVertexCount() != 0
  && mesh.getTriangleCount() != 0) {
for (VertexBuffer vb : mesh.getBufferList().getArray()) {
  if (vb.getData() != null && vb.getUsage() != VertexBuffer.Usage.CpuOnly) {
    renderer.updateBufferData(vb);

代码示例来源:origin: org.jmonkeyengine/jme3-core

for (VertexBuffer vb : mesh.getBufferList().getArray()) {
  if (vb.getBufferType() == Type.InterleavedData

代码示例来源:origin: us.ihmc.thirdparty.jme/jme3-lwjgl

for (VertexBuffer vb : mesh.getBufferList().getArray()) {
  if (vb.getBufferType() == Type.InterleavedData

代码示例来源:origin: org.jmonkeyengine/jme3-core

for (VertexBuffer vb : mesh.getBufferList().getArray()) {
  if (vb.getBufferType() == Type.InterleavedData

代码示例来源:origin: us.ihmc.thirdparty.jme/jme3-lwjgl

for (VertexBuffer vb : mesh.getBufferList().getArray()) {
  if (vb.getBufferType() == Type.InterleavedData

相关文章