Commits

Michael Ludwig  committed 3e7a000

Add polygon size to PolygonType enum

  • Participants
  • Parent commits 4f2cb44

Comments (0)

Files changed (1)

File ferox-renderer/ferox-renderer-api/src/main/java/com/ferox/renderer/Renderer.java

             public int getPolygonCount(int count) {
                 return count;
             }
+
+            @Override
+            public int getPolygonSize() {
+                return 1;
+            }
         },
         /**
          * Every two vertices form a line, so [i0, i1, i2, i3] creates 2 lines,
             public int getPolygonCount(int count) {
                 return count >> 1;
             }
+
+            @Override
+            public int getPolygonSize() {
+                return 2;
+            }
         },
         /**
          * Every three vertices form an individual triangle.
             public int getPolygonCount(int count) {
                 return count / 3;
             }
+
+            @Override
+            public int getPolygonSize() {
+                return 3;
+            }
         },
         /**
          * Every four vertices form a quadrilateral (ideally should be planar
             public int getPolygonCount(int count) {
                 return count >> 2;
             }
+
+            @Override
+            public int getPolygonSize() {
+                return 4;
+            }
         },
         /**
          * The first three vertices form a triangle, and then every subsequent
             public int getPolygonCount(int count) {
                 return Math.max(0, count - 2);
             }
+
+            @Override
+            public int getPolygonSize() {
+                return 3;
+            }
         },
         /**
          * The first four vertices form a quad, and then every two vertices form
             public int getPolygonCount(int count) {
                 return Math.max(0, count - 2) >> 1;
             }
+
+            @Override
+            public int getPolygonSize() {
+                return 4;
+            }
         };
 
         /**
          * @return The polygon count
          */
         public abstract int getPolygonCount(int numIndices);
+
+        /**
+         * Return the number of vertices in each polygon. The vertices may be
+         * shared by multiple polygons, this is just the number of vertices
+         * required for a single primitive. As an example, both TRIANGLES and
+         * TRIANGLE_STRIP return 3.
+         * 
+         * @return The number of vertices in a polygon
+         */
+        public abstract int getPolygonSize();
     }
 
     /**