gnu.gleem
Class NormalCalc

java.lang.Object
  |
  +--gnu.gleem.NormalCalc

public class NormalCalc
extends java.lang.Object

Calculates normals for a set of polygons.


Nested Class Summary
static class NormalCalc.NormalInfo
          Set of normals computed using NormalCalc.
 
Constructor Summary
NormalCalc()
           
 
Method Summary
static NormalCalc.NormalInfo computeFacetedNormals(Vec3f[] vertices, int[] indices, boolean ccw)
          Returns null upon failure, or a set of Vec3fs and integers which represent faceted (non-averaged) normals, but per-vertex.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NormalCalc

public NormalCalc()
Method Detail

computeFacetedNormals

public static NormalCalc.NormalInfo computeFacetedNormals(Vec3f[] vertices,
                                                          int[] indices,
                                                          boolean ccw)
Returns null upon failure, or a set of Vec3fs and integers which represent faceted (non-averaged) normals, but per-vertex. Performs bounds checking on indices with respect to vertex list. Index list must represent independent triangles; indices are taken in groups of three. If index list doesn't represent triangles or other error occurred then returns null. ccw flag indicates whether triangles are specified counterclockwise when viewed from top or not.