Aviatrix3D
2.1.0

org.j3d.renderer.aviatrix3d.geom
Class Cylinder

java.lang.Object
  extended by org.j3d.aviatrix3d.SceneGraphObject
      extended by org.j3d.aviatrix3d.Node
          extended by org.j3d.aviatrix3d.Leaf
              extended by org.j3d.aviatrix3d.Shape3D
                  extended by org.j3d.renderer.aviatrix3d.geom.Cylinder
All Implemented Interfaces:
java.lang.Comparable, NodeUpdateListener, PickableObject, PickTarget, SinglePickTarget, Cullable, LeafCullable, ObjectRenderable, Renderable, ShapeRenderable

public class Cylinder
extends Shape3D
implements NodeUpdateListener

A simple cylinder that uses triangle strips for rendering.

As we assume you may want to use this as a collidable object, we store the GeometryData instance that is used to create the object in the userData of the underlying TriangleStripArray. The geometry does not have texture coordinates set.

Version:
$Revision: 1.4 $
Author:
Justin Couch

Field Summary
 
Fields inherited from class org.j3d.aviatrix3d.Node
bounds, implicitBounds, INVALID_BOUNDS, parent
 
Fields inherited from class org.j3d.aviatrix3d.SceneGraphObject
alive, LISTENER_SET_TIMING_ERR_PROP, updateHandler
 
Fields inherited from interface org.j3d.aviatrix3d.picking.PickableObject
COLLIDABLE_OBJECT, GENERAL_OBJECT, PROXIMITY_OBJECT, VISIBLE_OBJECT
 
Fields inherited from interface org.j3d.aviatrix3d.picking.PickTarget
CUSTOM_PICK_TYPE, GROUP_PICK_TYPE, LEAF_PICK_TYPE, SINGLE_PICK_TYPE
 
Fields inherited from interface org.j3d.aviatrix3d.rendering.LeafCullable
AUDIO_CULLABLE, CLIP_CULLABLE, FOG_CULLABLE, GEOMETRY_CULLABLE, LIGHT_CULLABLE, OVERRIDE_CULLABLE
 
Constructor Summary
Cylinder()
          Construct a default cylinder with no appearance set.
Cylinder(Appearance app)
          Construct a default cylinder with the given appearance.
Cylinder(float height, float radius)
          Construct a default cylinder with no appearance set.
Cylinder(float height, float radius, Appearance app)
          Construct a default cylinder with the given appearance.
Cylinder(float height, float radius, int faces, Appearance app)
          Construct a cylinder with all the values customisable.
Cylinder(int faces)
          Construct a default cylinder with no appearance set and a custom number of faces.
Cylinder(int faces, Appearance app)
          Construct a default cylinder with the given appearance and a custom number of faces.
 
Method Summary
 void setDimensions(float height, float radius)
          Change the radius and height of the cylinder to the new values.
 void setFacetCount(int faces)
          Set the facet count of the cylinder to the new value.
 void updateNodeBoundsChanges(java.lang.Object src)
          Notification that its safe to update the node now with any operations that could potentially effect the node's bounds.
 void updateNodeDataChanges(java.lang.Object src)
          Notification that its safe to update the node now with any operations that only change the node's properties, but do not change the bounds.
 
Methods inherited from class org.j3d.aviatrix3d.Shape3D
checkForCyclicChild, checkPickMask, compareTo, compareTo, equals, equals, getAppearance, getAppearanceRenderable, getCenter, getCullableType, getGeometry, getGeometryRenderable, getPickableBounds, getPickableChild, getPickMask, getPickTargetType, getRenderable, is2D, isVisible, pickBatch, pickSingle, postRender, recomputeBounds, render, requestBoundsUpdate, setAppearance, setGeometry, setLive, setPickMask, setUpdateHandler, updateBounds
 
Methods inherited from class org.j3d.aviatrix3d.Node
boundsChanged, checkForCyclicParent, getBounds, getParent, markBoundsDirty, removeParent, setBounds, setParent, updateParentBounds
 
Methods inherited from class org.j3d.aviatrix3d.SceneGraphObject
dataChanged, getAppUpdateWriteTimingMessage, getBoundsWriteTimingMessage, getDataWriteTimingMessage, getUserData, isLive, setUserData
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.j3d.aviatrix3d.rendering.LeafCullable
getBounds
 

Constructor Detail

Cylinder

public Cylinder()
Construct a default cylinder with no appearance set. The default size of the cylinder is:
Height: 2.0
Radius: 1.0
Faces: 16


Cylinder

public Cylinder(Appearance app)
Construct a default cylinder with the given appearance. The default size of the cylinder is:
Height: 2.0
Radius: 1.0
Faces: 16

Parameters:
app - The appearance to use

Cylinder

public Cylinder(int faces)
Construct a default cylinder with no appearance set and a custom number of faces.
Height: 2.0
Radius: 1.0

Parameters:
faces - The number of faces to use around the side

Cylinder

public Cylinder(float height,
                float radius)
Construct a default cylinder with no appearance set. The height and radius as set to the new value and uses the default face count of 16.

Parameters:
height - The height of the cylinder
radius - The radius of the base of the cylinder

Cylinder

public Cylinder(int faces,
                Appearance app)
Construct a default cylinder with the given appearance and a custom number of faces.
Height: 2.0
Radius: 1.0

Parameters:
faces - The number of faces to use around the side
app - The appearance to use

Cylinder

public Cylinder(float height,
                float radius,
                Appearance app)
Construct a default cylinder with the given appearance. The height and radius as set to the new value and uses the default face count of 16.

Parameters:
height - The height of the cylinder
radius - The radius of the base of the cylinder
app - The appearance to use

Cylinder

public Cylinder(float height,
                float radius,
                int faces,
                Appearance app)
Construct a cylinder with all the values customisable.

Parameters:
height - The height of the cylinder
radius - The radius of the base of the cylinder
faces - The number of faces to use around the side
app - The appearance to use
Method Detail

updateNodeBoundsChanges

public void updateNodeBoundsChanges(java.lang.Object src)
Notification that its safe to update the node now with any operations that could potentially effect the node's bounds.

Specified by:
updateNodeBoundsChanges in interface NodeUpdateListener
Parameters:
src - The node or Node Component that is to be updated.

updateNodeDataChanges

public void updateNodeDataChanges(java.lang.Object src)
Notification that its safe to update the node now with any operations that only change the node's properties, but do not change the bounds.

Specified by:
updateNodeDataChanges in interface NodeUpdateListener
Parameters:
src - The node or Node Component that is to be updated.

setDimensions

public void setDimensions(float height,
                          float radius)
Change the radius and height of the cylinder to the new values. If the geometry write capability has been turned off, this will not do anything.

Parameters:
height - The height of the cylinder
radius - The radius of the base of the cylinder

setFacetCount

public void setFacetCount(int faces)
Set the facet count of the cylinder to the new value. If the geometry write capability has been turned off, this will not do anything.

Parameters:
faces - The number of faces to use around the side

Aviatrix3D
2.1.0

Latest Info from http://aviatrix3d.j3d.org/
Copyright © 2003 - 2009 j3d.org