sim.portrayal3d.simple
Class DirectionalLightPortrayal3D
java.lang.Object
javax.media.j3d.SceneGraphObject
javax.media.j3d.Node
javax.media.j3d.Leaf
javax.media.j3d.Light
javax.media.j3d.DirectionalLight
sim.portrayal3d.simple.DirectionalLightPortrayal3D
- All Implemented Interfaces:
- Portrayal, Portrayal3D, java.io.Serializable
- public class DirectionalLightPortrayal3D
- extends javax.media.j3d.DirectionalLight
- implements Portrayal3D
- See Also:
- Serialized Form
Fields inherited from class javax.media.j3d.DirectionalLight |
ALLOW_DIRECTION_READ, ALLOW_DIRECTION_WRITE |
Fields inherited from class javax.media.j3d.Light |
ALLOW_COLOR_READ, ALLOW_COLOR_WRITE, ALLOW_INFLUENCING_BOUNDS_READ, ALLOW_INFLUENCING_BOUNDS_WRITE, ALLOW_SCOPE_READ, ALLOW_SCOPE_WRITE, ALLOW_STATE_READ, ALLOW_STATE_WRITE |
Fields inherited from class javax.media.j3d.Node |
ALLOW_AUTO_COMPUTE_BOUNDS_READ, ALLOW_AUTO_COMPUTE_BOUNDS_WRITE, ALLOW_BOUNDS_READ, ALLOW_BOUNDS_WRITE, ALLOW_COLLIDABLE_READ, ALLOW_COLLIDABLE_WRITE, ALLOW_LOCAL_TO_VWORLD_READ, ALLOW_PICKABLE_READ, ALLOW_PICKABLE_WRITE, ENABLE_COLLISION_REPORTING, ENABLE_PICK_REPORTING |
Constructor Summary |
DirectionalLightPortrayal3D(javax.vecmath.Color3f color,
javax.vecmath.Vector3f direction)
Constructor DirectionalLightPortrayal3D. |
Method Summary |
Inspector |
getInspector(LocationWrapper wrapper,
GUIState state)
Provide an inspector for an object. |
javax.media.j3d.TransformGroup |
getModel(java.lang.Object obj,
javax.media.j3d.TransformGroup j3dModel)
If argument is null, it should behave like createModel;
otherwise, it is updateModel. |
java.lang.String |
getName(LocationWrapper wrapper)
Returns a name for the given object that is useful for a human
to distinguish it from other objects. |
void |
setParentPortrayal(FieldPortrayal3D p)
A non field portrayal3D need to enclose its parent FieldPortrayal into the PickInfo. |
void |
setPickIntersection(com.sun.j3d.utils.picking.PickIntersection pr)
|
boolean |
setSelected(LocationWrapper wrapper,
boolean selected)
Change the portrayal state to reflect the fact that you've
been selected or not selected. |
Methods inherited from class javax.media.j3d.DirectionalLight |
cloneNode, getDirection, setDirection, setDirection |
Methods inherited from class javax.media.j3d.Light |
addScope, getAllScopes, getColor, getEnable, getInfluencingBoundingLeaf, getInfluencingBounds, getScope, indexOfScope, insertScope, numScopes, removeAllScopes, removeScope, removeScope, setColor, setEnable, setInfluencingBoundingLeaf, setInfluencingBounds, setScope, updateNodeReferences |
Methods inherited from class javax.media.j3d.Node |
cloneTree, cloneTree, cloneTree, cloneTree, cloneTree, cloneTree, duplicateNode, getBounds, getBoundsAutoCompute, getCollidable, getLocalToVworld, getLocalToVworld, getParent, getPickable, setBounds, setBoundsAutoCompute, setCollidable, setPickable |
Methods inherited from class javax.media.j3d.SceneGraphObject |
clearCapability, clearCapabilityIsFrequent, duplicateSceneGraphObject, getCapability, getCapabilityIsFrequent, getUserData, isCompiled, isLive, setCapability, setCapabilityIsFrequent, setUserData |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DirectionalLightPortrayal3D
public DirectionalLightPortrayal3D(javax.vecmath.Color3f color,
javax.vecmath.Vector3f direction)
- Constructor DirectionalLightPortrayal3D.
- Parameters:
color
- direction
-
getModel
public javax.media.j3d.TransformGroup getModel(java.lang.Object obj,
javax.media.j3d.TransformGroup j3dModel)
- Description copied from interface:
Portrayal3D
- If argument is null, it should behave like createModel;
otherwise, it is updateModel.
The newly created version or the updated one should be returned.
The sub-scene graph repesented by a portrayal is wraped
in a TransformGroup, so the parent could place the child
at the apropriate position relative to the parent's coordinate system.
The child is responsible for positioning itself relative to its own
coordinate system. E.g. if the model assumes the position for an
object is the postion of its center/upper-left corner/etc, then
the portrayal for the object should have the center/upper-left
corner of the J3D model of the object in the origin of its
coorniate system.
- Specified by:
getModel
in interface Portrayal3D
getName
public java.lang.String getName(LocationWrapper wrapper)
- Description copied from interface:
Portrayal
- Returns a name for the given object that is useful for a human
to distinguish it from other objects. A simple default would
be just to return "" + object.
- Specified by:
getName
in interface Portrayal
getInspector
public Inspector getInspector(LocationWrapper wrapper,
GUIState state)
- Description copied from interface:
Portrayal
- Provide an inspector for an object.
- Specified by:
getInspector
in interface Portrayal
setSelected
public boolean setSelected(LocationWrapper wrapper,
boolean selected)
- Description copied from interface:
Portrayal
- Change the portrayal state to reflect the fact that you've
been selected or not selected. Always return true, except
if you've received a setSelected(true) and in fact do not
wish to be selectable, in which case return false in that
sole situation.
- Specified by:
setSelected
in interface Portrayal
setPickIntersection
public void setPickIntersection(com.sun.j3d.utils.picking.PickIntersection pr)
setParentPortrayal
public void setParentPortrayal(FieldPortrayal3D p)
- Description copied from interface:
Portrayal3D
- A non field portrayal3D need to enclose its parent FieldPortrayal into the PickInfo.
A FieldPortrayal3D should have an empty body.
- Specified by:
setParentPortrayal
in interface Portrayal3D