j3d.org Code

org.j3d.geom
Class CoordinateUtils

java.lang.Object
  extended by org.j3d.geom.CoordinateUtils

public class CoordinateUtils
extends java.lang.Object

A utility class that can be used to modify coordinate 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.

Version:
$Revision: 1.1 $
Author:
Justin Couch

Constructor Summary
CoordinateUtils()
          Create a default instance of the utility class.
 
Method Summary
 CoordinateUtils getSharedInstance()
          Fetch the currently shared singleton instance.
 void translate(float[][] srcCoords, int numCoords, float[][] destCoords, float x, float y, float z)
          Translate the coordintes by the given amount in each direction and place them in the destination array.
 void translate(float[][] coords, int numCoords, float x, float y, float z)
          Translate, in place, the coordintes by the given amount in each direction.
 void translate(float[] srcCoords, int numCoords, float[] destCoords, float x, float y, float z)
          Translate the coordintes by the given amount in each direction and place them in the destination array.
 void translate(float[] coords, int numCoords, float x, float y, float z)
          Translate, in place, the coordintes by the given amount in each direction.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CoordinateUtils

public CoordinateUtils()
Create a default instance of the utility class.

Method Detail

getSharedInstance

public CoordinateUtils getSharedInstance()
Fetch the currently shared singleton instance.

Returns:
The current instance

translate

public void translate(float[] coords,
                      int numCoords,
                      float x,
                      float y,
                      float z)
Translate, in place, the coordintes by the given amount in each direction. It assumes that the array has the coordinate values as a flat array of values.

Parameters:
coords - The source coordinate array to copy
numCoords - The number of valid coordinates in the array
x - The amount to translate in the x axis
y - The amount to translate in the y ayis
z - The amount to translate in the z azis

translate

public void translate(float[][] coords,
                      int numCoords,
                      float x,
                      float y,
                      float z)
Translate, in place, the coordintes by the given amount in each direction. It assumes that the array has the coordinate values as a flat array of values.

Parameters:
coords - The source coordinate array to copy
numCoords - The number of valid coordinates in the array
x - The amount to translate in the x axis
y - The amount to translate in the y ayis
z - The amount to translate in the z azis

translate

public void translate(float[] srcCoords,
                      int numCoords,
                      float[] destCoords,
                      float x,
                      float y,
                      float z)
Translate the coordintes by the given amount in each direction and place them in the destination array. It assumes that the array has the coordinate values as a flat array of values.

Parameters:
srcCoords - The source coordinate array to copy
numCoords - The number of valid coordinates in the array
destCoords - The array to copy the values into
x - The amount to translate in the x axis
y - The amount to translate in the y ayis
z - The amount to translate in the z azis

translate

public void translate(float[][] srcCoords,
                      int numCoords,
                      float[][] destCoords,
                      float x,
                      float y,
                      float z)
Translate the coordintes by the given amount in each direction and place them in the destination array. It assumes that the array has the coordinate values as a flat array of values.

Parameters:
srcCoords - The source coordinate array to copy
numCoords - The number of valid coordinates in the array
destCoords - The array to copy the values into
x - The amount to translate in the x axis
y - The amount to translate in the y ayis
z - The amount to translate in the z azis

j3d.org Code

Latest Info from http://code.j3d.org/
Copyright © 2001 - j3d.org