Procházet zdrojové kódy

Revert "Utility methods for getting arbitrary properties for triangles from mesh buffers"

This reverts commit f80d6474a4c9e69725a1de1fe13acdb07a56c2b4.
abies před 11 roky
rodič
revize
a6827ead5a
1 změnil soubory, kde provedl 3 přidání a 54 odebrání
  1. 3 54
      jme3-core/src/main/java/com/jme3/scene/Mesh.java

+ 3 - 54
jme3-core/src/main/java/com/jme3/scene/Mesh.java

@@ -824,28 +824,12 @@ public class Mesh implements Savable, Cloneable {
      * @param v3 Vector to contain third vertex position
      */
     public void getTriangle(int index, Vector3f v1, Vector3f v2, Vector3f v3){
-        getTriangle(Type.Position,index,v1,v2,v3);
-    }
-    
-    /**
-     * Gets the triangle vertex data at the given triangle index 
-     * and stores them into the v1, v2, v3 arguments. Works for 3-value components like position or normals
-     * 
-     * @param type buffer type to retrieve data from 
-     * @param index The index of the triangle. 
-     * Should be between 0 and {@link #getTriangleCount()}.
-     * 
-     * @param v1 Vector to contain first vertex data
-     * @param v2 Vector to contain second vertex data
-     * @param v3 Vector to contain third vertex data
-     */
-    public void getTriangle(Type type, int index, Vector3f v1, Vector3f v2, Vector3f v3){
-        VertexBuffer pb = getBuffer(type);
+        VertexBuffer pb = getBuffer(Type.Position);
         IndexBuffer ib = getIndicesAsList();
         if (pb != null && pb.getFormat() == Format.Float && pb.getNumComponents() == 3){
             FloatBuffer fpb = (FloatBuffer) pb.getData();
 
-            // acquire triangle's vertex indices
+            // aquire triangle's vertex indices
             int vertIndex = index * 3;
             int vert1 = ib.get(vertIndex);
             int vert2 = ib.get(vertIndex+1);
@@ -855,46 +839,11 @@ public class Mesh implements Savable, Cloneable {
             BufferUtils.populateFromBuffer(v2, fpb, vert2);
             BufferUtils.populateFromBuffer(v3, fpb, vert3);
         }else{
-            throw new UnsupportedOperationException(type + " buffer not set or "
+            throw new UnsupportedOperationException("Position buffer not set or "
                                                   + " has incompatible format");
         }
     }
     
-    /**
-     * Gets the triangle vertex data at the given triangle index 
-     * and stores them into the v1, v2, v3 arguments. Works for 2-value components like texture coordinates
-     * 
-     * @param type buffer type to retrieve data from 
-     * @param index The index of the triangle. 
-     * Should be between 0 and {@link #getTriangleCount()}.
-     * 
-     * @param v1 Vector to contain first vertex data
-     * @param v2 Vector to contain second vertex data
-     * @param v3 Vector to contain third vertex data
-     */
-
-    public void getTriangle(Type type, int index, Vector2f v1, Vector2f v2, Vector2f v3){
-        VertexBuffer pb = getBuffer(type);
-        IndexBuffer ib = getIndicesAsList();
-        if (pb != null && pb.getFormat() == Format.Float && pb.getNumComponents() == 2){
-            FloatBuffer fpb = (FloatBuffer) pb.getData();
-
-            // acquire triangle's vertex indices
-            int vertIndex = index * 3;
-            int vert1 = ib.get(vertIndex);
-            int vert2 = ib.get(vertIndex+1);
-            int vert3 = ib.get(vertIndex+2);
-
-            BufferUtils.populateFromBuffer(v1, fpb, vert1);
-            BufferUtils.populateFromBuffer(v2, fpb, vert2);
-            BufferUtils.populateFromBuffer(v3, fpb, vert3);
-        }else{
-            throw new UnsupportedOperationException(type + " buffer not set or "
-                                                  + " has incompatible format");
-        }
-    }
-    
-    
     /**
      * Gets the triangle vertex positions at the given triangle index 
      * and stores them into the {@link Triangle} argument.