|
j3d.org Code | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.j3d.geom.GeometryGenerator
org.j3d.geom.TorusGenerator
public class TorusGenerator
A generator of Torus geometry values.
The outer radius is the radius of the center of the tube that forms the torus.The torus has the outer radius in the X-Z plane and it increments along the positive Y axis. The loop starts at the origin on the positive X axis and rotates counter-clockwise when looking down the -Y axis towards the X-Z plane.
TODO
Look at trig optimisation techniques such as creating lookup tables.
Constructor Summary | |
---|---|
TorusGenerator()
Construct a default torus. |
|
TorusGenerator(float ir,
float or)
Construct a torus with the given inner and outer radius values. |
|
TorusGenerator(float ir,
float or,
int ifc,
int ofc)
Construct a torus with given radius values and number of facets. |
|
TorusGenerator(int ifc,
int ofc)
Construct a default torus with a selectable number of facets. |
Method Summary | |
---|---|
void |
generate(GeometryData data)
Generate a new set of geometry items shaped on the passed data. |
float[] |
getDimensions()
Get the dimensions of the cylinder. |
int |
getVertexCount(GeometryData data)
Get the number of vertices that this generator will create for the shape given in the definition. |
void |
setDimensions(float ir,
float or)
Change the dimensions of the torus to be generated. |
void |
setFacetCount(int ifc,
int ofc)
Change the number of facets used to create this cone. |
Methods inherited from class org.j3d.geom.GeometryGenerator |
---|
createFaceNormal, createFaceNormal, createRadialNormal, createRadialNormal |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TorusGenerator()
public TorusGenerator(float ir, float or)
ir
- The inner radius to useor
- The outer radius to usepublic TorusGenerator(int ifc, int ofc)
ifc
- The number of facets to use around the inner radiusofc
- The number of facets to use around the outer radius
java.lang.IllegalArgumentException
- The number of facets is less than 3public TorusGenerator(float ir, float or, int ifc, int ofc)
ir
- The inner radius to useor
- The outer radius to useifc
- The number of facets to use around the inner radiusofc
- The number of facets to use around the outer radius
java.lang.IllegalArgumentException
- The number of facets is less than 4Method Detail |
---|
public float[] getDimensions()
public void setDimensions(float ir, float or)
ir
- The ir of the cone to generateor
- The or of the bottom of the conepublic void setFacetCount(int ifc, int ofc)
ifc
- The number of facets to use around the inner radiusofc
- The number of facets to use around the outer radius
java.lang.IllegalArgumentException
- The number of facets is less than 4public int getVertexCount(GeometryData data) throws UnsupportedTypeException
getVertexCount
in class GeometryGenerator
data
- The data to shape the calculations on
UnsupportedTypeException
- The generator cannot handle the type
of geometry you have requested.public void generate(GeometryData data) throws UnsupportedTypeException, InvalidArraySizeException
generate
in class GeometryGenerator
data
- The data to shape the calculations on
InvalidArraySizeException
- The array is not big enough to contain
the requested geometry
UnsupportedTypeException
- The generator cannot handle the type
of geometry you have requested
|
j3d.org Code | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |