|
j3d.org Code | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.j3d.geom.NormalUtils
public class NormalUtils
A utility class that can be used to modify or create normal values of an item of geometry.
The utility class may be used as either a single shared instance or as a normal class. Sometimes you have a lot of different code all wanting to do similar modifications simultaneously and so having a single static-only class with synchronised methods would be very bad for performance.
Constructor Summary | |
---|---|
NormalUtils()
Create a default instance of the utility class. |
Method Summary | |
---|---|
void |
createFaceNormal(float[][] coords,
int p,
int p1,
int p2,
float[][] normals,
int offset)
Convenience method to create a normal for the given vertex coordinates and normal array. |
void |
createFaceNormal(float[] coords,
int p,
int p1,
int p2,
float[] normals,
int offset)
Convenience method to create a normal for the given vertex coordinates and normal array. |
void |
createRadialNormal(float[][] coords,
int p,
float[][] normals,
int offset)
Create a normal based on the given vertex position, assuming that it is a point in space, relative to the origin. |
void |
createRadialNormal(float[][] coords,
int p,
float[][] origin,
int originOffset,
float[][] normals,
int offset)
Create a normal based on the given vertex position, assuming that it is a point in space, relative to the given point. |
void |
createRadialNormal(float[] coords,
int p,
float[] normals,
int offset)
Create a normal based on the given vertex position, assuming that it is a point in space, relative to the origin. |
void |
createRadialNormal(float[] coords,
int p,
float[] origin,
int originOffset,
float[] normals,
int offset)
Create a normal based on the given vertex position, assuming that it is a point in space, relative to the given point. |
static NormalUtils |
getSharedInstance()
Fetch the currently shared singleton instance. |
void |
negate(float[][] normals,
int numNormals)
Negate the normals, in place. |
void |
negate(float[] normals,
int numNormals)
Negate the normals, in place. |
void |
negate(float[] srcNormals,
int numNormals,
float[] destNormals)
Translate the coordintes by the given amount in each direction and place them in the destination array. |
void |
translate(float[][] srcNormals,
int numNormals,
float[][] destNormals)
Translate the coordintes by the given amount in each direction and place them in the destination array. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public NormalUtils()
Method Detail |
---|
public static NormalUtils getSharedInstance()
public void negate(float[] normals, int numNormals)
normals
- The source coordinate array to copynumNormals
- The number of valid normals in the arraypublic void negate(float[][] normals, int numNormals)
normals
- The source coordinate array to copynumNormals
- The number of valid normals in the arraypublic void negate(float[] srcNormals, int numNormals, float[] destNormals)
srcNormals
- The source coordinate array to copynumNormals
- The number of valid coordinates in the arraydestNormals
- The array to copy the values intopublic void translate(float[][] srcNormals, int numNormals, float[][] destNormals)
srcNormals
- The source coordinate array to copynumNormals
- The number of valid coordinates in the arraydestNormals
- The array to copy the values intopublic void createFaceNormal(float[] coords, int p, int p1, int p2, float[] normals, int offset)
coords
- The coordinate array to read values fromp
- The index of the middle pointp1
- The index of the first pointp2
- The index of the second pointnormals
- The array to leave the computed result inoffset
- The offset into the normal array to place the normal valuespublic void createFaceNormal(float[][] coords, int p, int p1, int p2, float[][] normals, int offset)
coords
- The coordinate array to read values fromp
- The index of the middle pointp1
- The index of the first pointp2
- The index of the second pointnormals
- The array to leave the computed result inoffset
- The offset into the normal array to place the normal valuespublic void createRadialNormal(float[] coords, int p, float[] normals, int offset)
coords
- The coordinate array to read values fromp
- The index of the point to calculatenormals
- The array to leave the computed result inoffset
- The offset into the normal array to place the normal valuespublic void createRadialNormal(float[][] coords, int p, float[][] normals, int offset)
coords
- The coordinate array to read values fromp
- The index of the point to calculatenormals
- The array to leave the computed result inoffset
- The offset into the normal array to place the normal valuespublic void createRadialNormal(float[] coords, int p, float[] origin, int originOffset, float[] normals, int offset)
coords
- The coordinate array to read values fromp
- The index of the point to calculateorigin
- The origin to calculate relative tooriginOffset
- The offset into the origin array to usepublic void createRadialNormal(float[][] coords, int p, float[][] origin, int originOffset, float[][] normals, int offset)
coords
- The coordinate array to read values fromp
- The index of the point to calculateorigin
- The origin to calculate relative tooriginOffset
- The offset into the origin array to use
|
j3d.org Code | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |