Aviatrix3D
2.1.0

org.j3d.renderer.aviatrix3d.geom
Class Sphere

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.Sphere
All Implemented Interfaces:
java.lang.Comparable, NodeUpdateListener, PickableObject, PickTarget, SinglePickTarget, Cullable, LeafCullable, ObjectRenderable, Renderable, ShapeRenderable

public class Sphere
extends Shape3D
implements NodeUpdateListener

A simple sphere that uses triangle strips.

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.3 $
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
Sphere()
          Construct a default sphere with no appearance set.
Sphere(Appearance app)
          Construct a default sphere with the given appearance.
Sphere(float radius)
          Construct a default sphere with no appearance set.
Sphere(float radius, Appearance app)
          Construct a default sphere with the given appearance.
Sphere(float radius, int faces, Appearance app)
          Construct a sphere with all the values customisable.
Sphere(int faces)
          Construct a default sphere with no appearance set and a custom number of faces.
Sphere(int faces, Appearance app)
          Construct a default sphere with the given appearance and a custom number of faces.
 
Method Summary
 void setDimensions(float radius)
          Change the radius of the sphere to the new values.
 void setFacetCount(int faces)
          Set the facet count of the sphere 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

Sphere

public Sphere()
Construct a default sphere with no appearance set. The default size of the sphere is:
Radius: 1.0
Faces: 16


Sphere

public Sphere(Appearance app)
Construct a default sphere with the given appearance. The default size of the sphere is:
Radius: 1.0
Faces: 16

Parameters:
app - The appearance to use

Sphere

public Sphere(int faces)
Construct a default sphere with no appearance set and a custom number of faces.
Radius: 1.0

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

Sphere

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

Parameters:
radius - The radius of the base of the sphere

Sphere

public Sphere(int faces,
              Appearance app)
Construct a default sphere with the given appearance and a custom number of faces.
Radius: 1.0

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

Sphere

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

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

Sphere

public Sphere(float radius,
              int faces,
              Appearance app)
Construct a sphere with all the values customisable.

Parameters:
radius - The radius of the base of the sphere
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 radius)
Change the radius of the sphere to the new values. If the geometry write capability has been turned off, this will not do anything.

Parameters:
radius - The radius of the base of the sphere

setFacetCount

public void setFacetCount(int faces)
Set the facet count of the sphere 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