org.xith3d.scenegraph.primitives
Class Torus

java.lang.Object
  extended by org.xith3d.scenegraph.SceneGraphObject
      extended by org.xith3d.scenegraph.Node
          extended by org.xith3d.scenegraph.Leaf
              extended by org.xith3d.scenegraph.Shape3D
                  extended by org.xith3d.scenegraph.primitives.Torus
All Implemented Interfaces:
org.jagatoo.datatypes.NamableObject, org.jagatoo.datatypes.NamedObject, org.openmali.spatial.SpatialNode

public class Torus
extends Shape3D

A sphere using standard specifications.


Field Summary
 
Fields inherited from class org.xith3d.scenegraph.Node
bounds, boundsAutoCompute, boundsDirty, globalIgnoreBounds, instanceBoundsTypeHint, parent, transformGroup, untransformedBounds
 
Fields inherited from class org.xith3d.scenegraph.SceneGraphObject
XITH3D_USERDATAKEY_OLDUSERDATA
 
Constructor Summary
Torus(float radius, float alpha, int radSlices, int conSlices, Appearance app)
          Creates a torus.
Torus(float radius, float alpha, int radSlices, int conSlices, org.openmali.vecmath2.Colorf color)
          Creates a torus.
Torus(float radius, float alpha, int radSlices, int conSlices, int features, boolean colorAlpha, int texCoordsSize)
          Creates a torus.
Torus(float radius, float alpha, int radSlices, int conSlices, java.lang.String texture)
          Creates a torus.
Torus(float radius, float alpha, int radSlices, int conSlices, Texture texture)
          Creates a torus.
Torus(float alpha, int radSlices, int conSlices, Appearance app)
          Creates a torus.
Torus(float alpha, int radSlices, int conSlices, org.openmali.vecmath2.Colorf color)
          Creates a torus.
Torus(float alpha, int radSlices, int conSlices, int features, boolean colorAlpha, int texCoordsSize)
          Creates a torus.
Torus(float alpha, int radSlices, int conSlices, java.lang.String texture)
          Creates a torus.
Torus(float alpha, int radSlices, int conSlices, Texture texture)
          Creates a torus.
 
Method Summary
static GeometryArray createGeometry(float alpha, int radSlices, int conSlices, int features, boolean colorAlpha, int texCoordsSize)
          Creates the GeometryArray for a Torus.
static GeometryConstruct createGeometryConstructITA(float alpha, int radSlices, int conSlices, int features, boolean colorAlpha, int texCoordsSize)
          Creates the GeometryConstruct for a Torus made of an IndexedTriangleArray.
static GeometryConstruct createGeometryConstructITSA(float alpha, int radSlices, int conSlices, int features, boolean colorAlpha, int texCoordsSize)
          Creates the GeometryConstruct for a Torus made of an IndexedTriangleStripArray.
static GeometryConstruct createGeometryConstructTA(float alpha, int radSlices, int conSlices, int features, boolean colorAlpha, int texCoordsSize)
          Creates the GeometryConstruct for a Torus made of a TriangleArray.
static GeometryConstruct createGeometryConstructTSA(float alpha, int radSlices, int conSlices, int features, boolean colorAlpha, int texCoordsSize)
          Creates the GeometryConstruct for a Torus made of a TriangleStripArray.
static IndexedTriangleArray createGeometryITA(float alpha, int radSlices, int conSlices, int features, boolean colorAlpha, int texCoordsSize)
          Creates the IndexedTriangleArray for a Torus.
static IndexedTriangleStripArray createGeometryITSA(float alpha, int radSlices, int conSlices, int features, boolean colorAlpha, int texCoordsSize)
          Creates the IndexedTriangleStripArray for a Torus.
static TriangleArray createGeometryTA(float alpha, int radSlices, int conSlices, int features, boolean colorAlpha, int texCoordsSize)
          Creates the TriangleArray for a Torus.
static TriangleStripArray createGeometryTSA(float alpha, int radSlices, int conSlices, int features, boolean colorAlpha, int texCoordsSize)
          Creates the TriangleStripArray for a Torus.
static GeometryType getGeometryConstructionTypeHint()
           
static void setGeometryConstructionTypeHint(GeometryType hint)
          Sets the hint for this ShapeType's Geometry to be constructed of a certain type.
 
Methods inherited from class org.xith3d.scenegraph.Shape3D
absorbDetails, freeOpenGLResources, getAppearance, getAppearance, getGeometry, isBumpMappingEnabled, isShadowReceiver, isVisible, newAppearance, setAppearance, setBounds, setBumpMappingEnabled, setBumpMappingEnabled, setGeometry, setIsShadowReceiver, setLive, setModListener, setVisible, sharedCopy, sharedCopy, traverse, updateBounds, updateBoundsCheap, updateWorldTransform, verifyAppChange
 
Methods inherited from class org.xith3d.scenegraph.Leaf
dump, getPickHost, setPickHost
 
Methods inherited from class org.xith3d.scenegraph.Node
cloneNode, detach, duplicateNode, freeOpenGLResources, getBounds, getBoundsAutoCompute, getBoundsType, getBoundsTypeHint, getDefaultPickable, getIndentString, getInheritedNodeAttributes, getModListener, getOrderedChild, getOrderedState, getParent, getRoot, getShadowAttachment, getShowBounds, getTransformGroup, getTreeCell, getWorldBounds, getWorldTransform, getWorldTransform, isBillboard, isIgnoreBounds, isOccluder, isPickable, isRenderable, isUpdatableNode, mergeInheritedClipper, mergeInheritedNodes, mergeInheritedScissorRect, popGlobalIgnoreBounds, printBounds, pushGlobalIgnoreBounds, setBoundsAutoCompute, setBoundsDirty, setBoundsDirtyUpward, setBoundsTypeHint, setDefaultPickable, setGlobalIgnoreBounds, setIgnoreBounds, setIsOccluder, setOrderedChild, setParent, setPickable, setPickableRecursive, setPickableRecursive, setRenderable, setShadowAttachment, setShowBounds, setTransformGroup, setTreeCell, traverse, unmergeInheritedFog, unmergeInheritedLight, unmergeInheritedNodes, updateOrderedChild, updateTransformGroup
 
Methods inherited from class org.xith3d.scenegraph.SceneGraphObject
getName, getUserData, getUserData, getUserDataMap, isLive, setName, setUserData, setUserData, setUserDataRecursive, setUserDataRecursive, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Torus

public Torus(float alpha,
             int radSlices,
             int conSlices,
             int features,
             boolean colorAlpha,
             int texCoordsSize)
Creates a torus. Generating equations: x = (rc + rr * cos( v )) * cos( u ) y = (rc + rr * cos( v )) * sin( u ) z = rr * sin( v )

Parameters:
alpha - 0.5 for donut shape, 0.25 for a smaller hole
radSlices - Number of radial slices (from the center). Must be >=3
conSlices - Number of concentric slices in the ring. Must be >=3
features - Generate the data for GeometryArray.COLOR_3 | GeometryArray.NORMALS | ...
colorAlpha -
texCoordsSize -

Torus

public Torus(float radius,
             float alpha,
             int radSlices,
             int conSlices,
             int features,
             boolean colorAlpha,
             int texCoordsSize)
Creates a torus.

Parameters:
radius - the outer radius of the Torus
alpha - 0.5 for donut shape, 0.25 for a smaller hole
radSlices - Number of radial slices (from the center). Must be >=3
conSlices - Number of concentric slices in the ring. Must be >=3
features - Generate the data for GeometryArray.COLOR_3 | GeometryArray.NORMALS | ...
colorAlpha -
texCoordsSize -
See Also:
StaticTransform.scale(Shape3D, float)

Torus

public Torus(float alpha,
             int radSlices,
             int conSlices,
             Texture texture)
Creates a torus. Generating equations: x = (rc + rr * cos( v )) * cos( u ) y = (rc + rr * cos( v )) * sin( u ) z = rr * sin( v )

Parameters:
alpha - 0.5 for donut shape, 0.25 for a smaller hole
radSlices - Number of radial slices (from the center). Must be >=3
conSlices - Number of concentric slices in the ring. Must be >=3
texture - the Texture to be applied to the Shape's Appearance

Torus

public Torus(float radius,
             float alpha,
             int radSlices,
             int conSlices,
             Texture texture)
Creates a torus.

Parameters:
radius - the outer radius of the Torus
alpha - 0.5 for donut shape, 0.25 for a smaller hole
radSlices - Number of radial slices (from the center). Must be >=3
conSlices - Number of concentric slices in the ring. Must be >=3
texture - the Texture to be applied to the Shape's Appearance
See Also:
StaticTransform.scale(Shape3D, float)

Torus

public Torus(float alpha,
             int radSlices,
             int conSlices,
             java.lang.String texture)
Creates a torus. Generating equations: x = (rc + rr * cos( v )) * cos( u ) y = (rc + rr * cos( v )) * sin( u ) z = rr * sin( v )

Parameters:
alpha - 0.5 for donut shape, 0.25 for a smaller hole
radSlices - Number of radial slices (from the center). Must be >=3
conSlices - Number of concentric slices in the ring. Must be >=3
texture - the Texture to be applied to the Shape's Appearance

Torus

public Torus(float radius,
             float alpha,
             int radSlices,
             int conSlices,
             java.lang.String texture)
Creates a torus.

Parameters:
radius - the outer radius of the Torus
alpha - 0.5 for donut shape, 0.25 for a smaller hole
radSlices - Number of radial slices (from the center). Must be >=3
conSlices - Number of concentric slices in the ring. Must be >=3
texture - the Texture to be applied to the Shape's Appearance
See Also:
StaticTransform.scale(Shape3D, float)

Torus

public Torus(float alpha,
             int radSlices,
             int conSlices,
             org.openmali.vecmath2.Colorf color)
Creates a torus. Generating equations: x = (rc + rr * cos( v )) * cos( u ) y = (rc + rr * cos( v )) * sin( u ) z = rr * sin( v )

Parameters:
alpha - 0.5 for donut shape, 0.25 for a smaller hole
radSlices - Number of radial slices (from the center). Must be >=3
conSlices - Number of concentric slices in the ring. Must be >=3
color - the color to be applied to the Shape's Appearance's ColoringAttributes

Torus

public Torus(float radius,
             float alpha,
             int radSlices,
             int conSlices,
             org.openmali.vecmath2.Colorf color)
Creates a torus.

Parameters:
radius - the outer radius of the Torus
alpha - 0.5 for donut shape, 0.25 for a smaller hole
radSlices - Number of radial slices (from the center). Must be >=3
conSlices - Number of concentric slices in the ring. Must be >=3
color - the color to be applied to the Shape's Appearance's ColoringAttributes
See Also:
StaticTransform.scale(Shape3D, float)

Torus

public Torus(float alpha,
             int radSlices,
             int conSlices,
             Appearance app)
Creates a torus. Generating equations: x = (rc + rr * cos( v )) * cos( u ) y = (rc + rr * cos( v )) * sin( u ) z = rr * sin( v )

Parameters:
alpha - 0.5 for donut shape, 0.25 for a smaller hole
radSlices - Number of radial slices (from the center). Must be >=3
conSlices - Number of concentric slices in the ring. Must be >=3
app - the Appearance to be applied to this Shape

Torus

public Torus(float radius,
             float alpha,
             int radSlices,
             int conSlices,
             Appearance app)
Creates a torus.

Parameters:
radius - the outer radius of the Torus
alpha - 0.5 for donut shape, 0.25 for a smaller hole
radSlices - Number of radial slices (from the center). Must be >=3
conSlices - Number of concentric slices in the ring. Must be >=3
app - the Appearance to be applied to this Shape
See Also:
StaticTransform.scale(Shape3D, float)
Method Detail

setGeometryConstructionTypeHint

public static void setGeometryConstructionTypeHint(GeometryType hint)
Sets the hint for this ShapeType's Geometry to be constructed of a certain type.

Parameters:
hint -

getGeometryConstructionTypeHint

public static GeometryType getGeometryConstructionTypeHint()
Returns:
the hint for this ShapeType's Geometry to be constructed of a certain type.

createGeometryConstructITSA

public static GeometryConstruct createGeometryConstructITSA(float alpha,
                                                            int radSlices,
                                                            int conSlices,
                                                            int features,
                                                            boolean colorAlpha,
                                                            int texCoordsSize)
Creates the GeometryConstruct for a Torus made of an IndexedTriangleStripArray.

Parameters:
alpha - Ratio of ring thickness to ring diameter (alpha=.5 -> donut shape)
radSlices - Number of radial slices (from the center). Must be >=3
conSlices - Number of concentric slices in the ring. Must be >=3
features - Generate the data for GeometryArray.COLOR_3 | GeometryArray.NORMALS | ...
colorAlpha -
texCoordsSize -

createGeometryITSA

public static IndexedTriangleStripArray createGeometryITSA(float alpha,
                                                           int radSlices,
                                                           int conSlices,
                                                           int features,
                                                           boolean colorAlpha,
                                                           int texCoordsSize)
Creates the IndexedTriangleStripArray for a Torus.

Parameters:
alpha - Ratio of ring thickness to ring diameter (alpha=.5 -> donut shape)
radSlices - Number of radial slices (from the center). Must be >=3
conSlices - Number of concentric slices in the ring. Must be >=3
features - Generate the data for GeometryArray.NORMALS | GeometryArray.TEXTURE_COORDINATES | ...
colorAlpha -
texCoordsSize -

createGeometryConstructITA

public static GeometryConstruct createGeometryConstructITA(float alpha,
                                                           int radSlices,
                                                           int conSlices,
                                                           int features,
                                                           boolean colorAlpha,
                                                           int texCoordsSize)
Creates the GeometryConstruct for a Torus made of an IndexedTriangleArray.

Parameters:
alpha - Ratio of ring thickness to ring diameter (alpha=.5 -> donut shape)
radSlices - Number of radial slices (from the center). Must be >=3
conSlices - Number of concentric slices in the ring. Must be >=3
features - Generate the data for GeometryArray.COLOR_3 | GeometryArray.NORMALS | ...
colorAlpha -
texCoordsSize -

createGeometryITA

public static IndexedTriangleArray createGeometryITA(float alpha,
                                                     int radSlices,
                                                     int conSlices,
                                                     int features,
                                                     boolean colorAlpha,
                                                     int texCoordsSize)
Creates the IndexedTriangleArray for a Torus.

Parameters:
alpha - Ratio of ring thickness to ring diameter (alpha=.5 -> donut shape)
radSlices - Number of radial slices (from the center). Must be >=3
conSlices - Number of concentric slices in the ring. Must be >=3
features - Generate the data for GeometryArray.COLOR_3 | GeometryArray.NORMALS | ...
colorAlpha -
texCoordsSize -

createGeometryConstructTSA

public static GeometryConstruct createGeometryConstructTSA(float alpha,
                                                           int radSlices,
                                                           int conSlices,
                                                           int features,
                                                           boolean colorAlpha,
                                                           int texCoordsSize)
Creates the GeometryConstruct for a Torus made of a TriangleStripArray.

Parameters:
alpha - Ratio of ring thickness to ring diameter (alpha=.5 -> donut shape)
radSlices - Number of radial slices (from the center). Must be >=3
conSlices - Number of concentric slices in the ring. Must be >=3
features - Generate the data for GeometryArray.COLOR_3 | GeometryArray.NORMALS | ...
colorAlpha -
texCoordsSize -

createGeometryTSA

public static TriangleStripArray createGeometryTSA(float alpha,
                                                   int radSlices,
                                                   int conSlices,
                                                   int features,
                                                   boolean colorAlpha,
                                                   int texCoordsSize)
Creates the TriangleStripArray for a Torus.

Parameters:
alpha - Ratio of ring thickness to ring diameter (alpha=.5 -> donut shape)
radSlices - Number of radial slices (from the center). Must be >=3
conSlices - Number of concentric slices in the ring. Must be >=3
features - Generate the data for GeometryArray.COLOR_3 | GeometryArray.NORMALS | ...
colorAlpha -
texCoordsSize -

createGeometryConstructTA

public static GeometryConstruct createGeometryConstructTA(float alpha,
                                                          int radSlices,
                                                          int conSlices,
                                                          int features,
                                                          boolean colorAlpha,
                                                          int texCoordsSize)
Creates the GeometryConstruct for a Torus made of a TriangleArray.

Parameters:
alpha - Ratio of ring thickness to ring diameter (alpha=.5 -> donut shape)
radSlices - Number of radial slices (from the center). Must be >=3
conSlices - Number of concentric slices in the ring. Must be >=3
features - Generate the data for GeometryArray.COLOR_3 | GeometryArray.NORMALS | ...
colorAlpha -
texCoordsSize -

createGeometryTA

public static TriangleArray createGeometryTA(float alpha,
                                             int radSlices,
                                             int conSlices,
                                             int features,
                                             boolean colorAlpha,
                                             int texCoordsSize)
Creates the TriangleArray for a Torus.

Parameters:
alpha - Ratio of ring thickness to ring diameter (alpha=.5 -> donut shape)
radSlices - Number of radial slices (from the center). Must be >=3
conSlices - Number of concentric slices in the ring. Must be >=3
features - Generate the data for GeometryArray.COLOR_3 | GeometryArray.NORMALS | ...
colorAlpha -
texCoordsSize -

createGeometry

public static GeometryArray createGeometry(float alpha,
                                           int radSlices,
                                           int conSlices,
                                           int features,
                                           boolean colorAlpha,
                                           int texCoordsSize)
Creates the GeometryArray for a Torus.

Parameters:
alpha - Ratio of ring thickness to ring diameter (alpha=.5 -> donut shape)
radSlices - Number of radial slices (from the center). Must be >=3
conSlices - Number of concentric slices in the ring. Must be >=3
features - Generate the data for GeometryArray.COLOR_3 | GeometryArray.NORMALS | ...
colorAlpha -
texCoordsSize -