|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--yaarq.sys.yrqFrame
This class serves as a transformable root to which other frames or visuals can be added. Frames build the Yaarq engines internal scene graph.
A frame is attached to the root frame kept internally by the engine, or to another frame. Frames can only be attached or detached at live-time when the root frame has been detached from the scene graph. It is common practice to construct complex objects from a root frame on, and to attach that root frame to the engine when needed.
Visuals can be added to frames to provide geometry to be displayed at the position and with the orientation provided by the frame. BasicVisuals and EffectVisuals can be added, the other visual types have to be added to defined roots in the engine class.
Frames provide support for animation. Animation keys can be stored in a frame under a name. At runtime, applications can set the desired target animation key and a frame will seamlessly transit from its current transform state to the target state. Another option is to set two animation keys, a source and a target: A frame will seamlessly transform from source to target in this case. Finally, setting an array of animation keys to create an animation path is supported. TODO: Incorporate rotation into setting anikeys, provide methods for translating, moving and rotation the frame without animation key (extend the relative/absolute approach)
| Constructor Summary | |
yrqFrame()
Constructs a new, empty instance |
|
| Method Summary | |
void |
addAnimationKey(java.lang.String a_name,
com.sun.j3d.utils.behaviors.interpolators.KBKeyFrame a_key)
This method adds a new animation key to the frame. |
void |
addChild(java.lang.String a_name,
yrqFrame a_child)
This method adds a yrqFrame instance as a child to this frame. |
void |
addVisual(java.lang.String a_name,
yrqVisual a_visual)
This method adds a visual to the frame. |
void |
attach(javax.media.j3d.BranchGroup a_group)
This method attaches the frame to a parent. |
void |
attach(javax.media.j3d.BranchGroup a_group,
javax.media.j3d.BranchGroup a_root)
This method attaches the frame to a parent and sets the root branch so that the frame can detach itself at runtime. |
void |
attach(javax.media.j3d.TransformGroup a_group)
This method attaches the frame to a parent. |
void |
clearAnimationKeys()
This method clears all animation keys from the key list. |
void |
clearVisuals()
This method clears all visuals from the hierarchy, detaching them in the process. |
void |
compile()
This function compiles the local branch graph of the frame It is automatically called by the engine before a frame is attached to the scene root. |
void |
detach()
This method detaches the frame from its current parent. |
javax.vecmath.Vector3d |
getAbsoluteDirection()
This function retrieves the absolute direction, as a unit vector, of this frame in world coordinates. |
javax.vecmath.Point3d |
getAbsolutePosition()
This function retrieves the location of the center of the frame in world coordinates. |
com.sun.j3d.utils.behaviors.interpolators.KBKeyFrame |
getAnimationKey(java.lang.String a_name)
This method retrieves an animationkey by name |
yrqFrame |
getChild(java.lang.String a_name)
This function returns a child frame specified by name, or null if no child exists under the given name. |
javax.media.j3d.TransformGroup |
getInternalGroup()
This function returns the frames internal transform group. |
javax.media.j3d.Group |
getParent()
This function returns the parent group this frame is currently attached to or null, if it isnt attached to a group. |
javax.vecmath.Vector3d |
getRelativeDirection()
This function retrieves the relative direction, as a unit vector, of this frame in local coordinates. |
javax.vecmath.Point3d |
getRelativePosition()
This function retrieves the location of the center of the frame in local coordinates. |
yrqVisual |
getVisual(java.lang.String a_name)
This method retrieves a visual which has been added to the frame by its name. |
java.util.Iterator |
getVisuals()
This method returns an iterator over all visuals attached to this frame . |
void |
removeAnimationKey(com.sun.j3d.utils.behaviors.interpolators.KBKeyFrame a_key)
This method removes an animation key by reference |
void |
removeAnimationKey(java.lang.String a_name)
This method removes an animation key by name |
void |
removeChild(java.lang.String a_name)
This method removes a yrqFrame instance From this frame. |
void |
removeChild(yrqFrame a_frame)
This method removes a yrqFrame instance From this frame. |
void |
removeVisual(java.lang.String a_name)
This method removes a visual specified by name from the frame. |
void |
setAnimationKey(java.lang.String a_name)
This method sets the target animation key for the frame and all its hierarchical children which have inheritance enabled and have a key of the same name assigned. |
void |
setAnimationSequence(java.lang.String[] a_keyName)
This method sets an animation key sequence for frame and all its hierarchical children which have inheritance enabled and have keys of the same name assigned. |
void |
setAnimationSequence(java.lang.String a_srcname,
java.lang.String a_dstname)
This method sets source and target animation key for frame and all its hierarchical children which have inheritance enabled and have a key of the same name assigned. |
void |
setAnimationTime(float a_time)
This method sets the time in the animation from source to target animation key. |
void |
setRelativeLookat(javax.vecmath.Point3d a_position,
javax.vecmath.Point3d a_target)
This method sets the location and orientation of the frame relatively to its parent by using a look-at from the given camera to the given target. |
void |
setRelativeLookat(javax.vecmath.Point3d a_position,
javax.vecmath.Point3d a_target,
javax.vecmath.Vector3d a_up)
This method sets the location and orientation of the frame relatively to its parent by using a look-at from the given camera to the given target. |
void |
setRelativePosition(javax.vecmath.Point3d a_position)
This method sets the location of the center of the frame relatively to its parent. |
void |
setRelativeRotation(javax.vecmath.AxisAngle4d a_angle)
This method sets the rotation of the frame relatively to its parent. |
void |
setSize(double a_size)
.. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public yrqFrame()
| Method Detail |
public void addAnimationKey(java.lang.String a_name,
com.sun.j3d.utils.behaviors.interpolators.KBKeyFrame a_key)
a_name - The name under which to add the keya_key - The animationkey
public void addChild(java.lang.String a_name,
yrqFrame a_child)
Children can only be added to a frame as long as it isnt attached to the engine by adding it, or its parent hierarchy, to the engine.
a_name - The name under which to add the framea_child - The frame to be added
public void addVisual(java.lang.String a_name,
yrqVisual a_visual)
Visuals added to the viewport frame are automatically moved with the viewport: OverlayVisuals and FlareVisuals should be added to the viewport frame to achieve their functionallity.
Visuals added to frames attached to the engine are automatically moved with their respective frames. BasicVisuals and EffectVisuals should be added to engine-frames to form world objects.
Visuals can only be added to a frame as long as it isnt attached to the engine by adding it, or its parent hierarchy, to the engine.
a_name - The name under which to add the visuala_visual - The visual to be addedpublic void attach(javax.media.j3d.BranchGroup a_group)
a_group - The branch group to which to attach
public void attach(javax.media.j3d.BranchGroup a_group,
javax.media.j3d.BranchGroup a_root)
a_group - The branch group to which to attacha_root - The root to which the frame's parent is attachedpublic void attach(javax.media.j3d.TransformGroup a_group)
a_group - The transform group to which to attachpublic void clearAnimationKeys()
public void clearVisuals()
public void compile()
public void detach()
public javax.vecmath.Vector3d getAbsoluteDirection()
public javax.vecmath.Point3d getAbsolutePosition()
public com.sun.j3d.utils.behaviors.interpolators.KBKeyFrame getAnimationKey(java.lang.String a_name)
a_name - The name of the desired key
public yrqFrame getChild(java.lang.String a_name)
public javax.media.j3d.TransformGroup getInternalGroup()
public javax.media.j3d.Group getParent()
public javax.vecmath.Vector3d getRelativeDirection()
public javax.vecmath.Point3d getRelativePosition()
public yrqVisual getVisual(java.lang.String a_name)
a_name - The name of the visual to be retrieved
public java.util.Iterator getVisuals()
public void removeAnimationKey(com.sun.j3d.utils.behaviors.interpolators.KBKeyFrame a_key)
a_key - The key to removepublic void removeAnimationKey(java.lang.String a_name)
a_name - The name of the key to removepublic void removeChild(java.lang.String a_name)
Children can only be removed to a frame as long as it isnt attached to the engine by adding it, or its parent hierarchy, to the engine.
a_name - The name of the frame to be detachedpublic void removeChild(yrqFrame a_frame)
Children can only be removed to a frame as long as it isnt attached to the engine by adding it, or its parent hierarchy, to the engine.
a_frame - the frame to be removedpublic void removeVisual(java.lang.String a_name)
Visuals can only be added to a frame as long as it isnt attached to the engine by adding it, or its parent hierarchy, to the engine.
a_name - The name of the visual to be removedpublic void setAnimationKey(java.lang.String a_name)
a_name - The name of the animation key to setpublic void setAnimationSequence(java.lang.String[] a_keyName)
a_keyName - The names of the animation keys to set. Note: Keys must have time values assigned.
public void setAnimationSequence(java.lang.String a_srcname,
java.lang.String a_dstname)
a_srcname - The name of the source animation key to seta_dstname - The name of the destination animation keypublic void setAnimationTime(float a_time)
a_time - The animation time, 0-1
public void setRelativeLookat(javax.vecmath.Point3d a_position,
javax.vecmath.Point3d a_target)
a_position - The position to which to translate the objecta_target - The position towards which to orient the object
public void setRelativeLookat(javax.vecmath.Point3d a_position,
javax.vecmath.Point3d a_target,
javax.vecmath.Vector3d a_up)
a_position - The position to which to translate the objecta_target - The position towards which to orient the objecta_up - The up vectorpublic void setRelativePosition(javax.vecmath.Point3d a_position)
a_position - The position to which to translate the objectpublic void setRelativeRotation(javax.vecmath.AxisAngle4d a_angle)
public void setSize(double a_size)
a_size - The new relative size of the object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||