Aviatrix3D
2.1.0

org.j3d.renderer.aviatrix3d.geom
Class Box

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

public class Box
extends Shape3D
implements NodeUpdateListener

A simple box primitive.

The geometry is only created with normal and coordinates. Texture coordinates are not generated.

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
Box()
          Construct a default box with no appearance set.
Box(Appearance app)
          Construct a default box with the given appearance.
Box(float width, float height, float depth)
          Construct a default box with no appearance set.
Box(float width, float height, float depth, Appearance app)
          Construct a default box with the given appearance and dimensions.
 
Method Summary
 void setDimensions(float width, float height, float depth)
          Change the radius and height of the box to the new values.
 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

Box

public Box()
Construct a default box with no appearance set. The default size of the box is:
Width: 2.0
Height: 2.0
Depth: 2.0


Box

public Box(Appearance app)
Construct a default box with the given appearance. The default size of the box is:
Width: 2.0
Height: 2.0
Depth: 2.0

Parameters:
app - The appearance to use

Box

public Box(float width,
           float height,
           float depth)
Construct a default box with no appearance set. The dimensions are set to the given values

Parameters:
width - The width of the box (X Axis)
height - The height of the box (Y Axis)
depth - The depth of the box (Z Axis)

Box

public Box(float width,
           float height,
           float depth,
           Appearance app)
Construct a default box with the given appearance and dimensions.

Parameters:
width - The width of the box (X Axis)
height - The height of the box (Y Axis)
depth - The depth of the box (Z Axis)
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 width,
                          float height,
                          float depth)
Change the radius and height of the box to the new values. If the geometry write capability has been turned off, this will not do anything.

Parameters:
width - The width of the box (X Axis)
height - The height of the box (Y Axis)
depth - The depth of the box (Z Axis)

Aviatrix3D
2.1.0

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