gnu.gleem
Class Translate1Manip

java.lang.Object
  |
  +--gnu.gleem.Manip
        |
        +--gnu.gleem.Translate1Manip

public class Translate1Manip
extends Manip

A Translate1Manip is a Manip which translates in only one dimension and whose default representation is a two-way arrow.


Constructor Summary
Translate1Manip()
           
 
Method Summary
 void clearHighlight()
          Tell the manipulator to clear the current highlight
 void drag(Vec3f rayStart, Vec3f rayDirection)
          When a manipulator is active, drags of the live portion cause motion of the manipulator.
 Vec3f getAxis()
          Get the axis of this Translate1Manip.
 Vec3f getScale()
           
 Vec3f getTranslation()
          Get the translation of this Translate1Manip.
 void highlight(HitPoint hit)
          Tell the manipulator to highlight the current portion of itself.
 void intersectRay(Vec3f rayStart, Vec3f rayDirection, java.util.List results)
          Cast a ray in 3-space from the camera start position in the specified direction and test for intersections against all live portions of this manipulator.
 void makeActive(HitPoint hit)
          If the ManipManager decides that this manipulator is to become active, it will pass back the HitPoint which made it make its decision.
 void makeInactive()
          When the mouse button is released, makeInactive() is called.
 void render(gl4java.GLFunc gl)
          Render this Manipulator now using the given OpenGL routines and assuming an OpenGL context is current.
 void replaceGeometry(ManipPart geom)
          Change the geometry of this manipulator to be the user-defined piece.
 void setAxis(Vec3f axis)
          Set the axis of this Translate1Manip.
 void setScale(Vec3f scale)
          Set the scale of the Translate1Manip.
 void setTranslation(Vec3f translation)
          Set the translation of this Translate1Manip.
 
Methods inherited from class gnu.gleem.Manip
addMotionListener, removeMotionListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Translate1Manip

public Translate1Manip()
Method Detail

setTranslation

public void setTranslation(Vec3f translation)
Set the translation of this Translate1Manip. This moves its on-screen representation. Manipulations cause the translation to be modified, not overwritten, so if you want the default Translate1Manip to go through the point (0, 1, 0) but still translate along the X axis, then setTranslation(0, 1, 0).


getTranslation

public Vec3f getTranslation()
Get the translation of this Translate1Manip. This corresponds to the center of its body.


setAxis

public void setAxis(Vec3f axis)
Set the axis of this Translate1Manip. This is the direction along which it will travel. Does not need to be normalized, but must not be the zero vector.


getAxis

public Vec3f getAxis()
Get the axis of this Translate1Manip.


setScale

public void setScale(Vec3f scale)
Set the scale of the Translate1Manip. This only affects the size of the on-screen geometry.


getScale

public Vec3f getScale()

replaceGeometry

public void replaceGeometry(ManipPart geom)
Change the geometry of this manipulator to be the user-defined piece.


intersectRay

public void intersectRay(Vec3f rayStart,
                         Vec3f rayDirection,
                         java.util.List results)
Description copied from class: Manip
Cast a ray in 3-space from the camera start position in the specified direction and test for intersections against all live portions of this manipulator. Add all hits, in arbitrary order, to the end of the given list in the form of HitPoints. Must not modify the results vector in any other way (i.e., must not remove any existing HitPoints from the results vector).

Specified by:
intersectRay in class Manip

highlight

public void highlight(HitPoint hit)
Description copied from class: Manip
Tell the manipulator to highlight the current portion of itself. This is merely visual feedback to the user.

Specified by:
highlight in class Manip

clearHighlight

public void clearHighlight()
Description copied from class: Manip
Tell the manipulator to clear the current highlight

Specified by:
clearHighlight in class Manip

makeActive

public void makeActive(HitPoint hit)
Description copied from class: Manip
If the ManipManager decides that this manipulator is to become active, it will pass back the HitPoint which made it make its decision. The manipulator can then change its state to look for drags of this portion of the manipulator.

Specified by:
makeActive in class Manip

drag

public void drag(Vec3f rayStart,
                 Vec3f rayDirection)
Description copied from class: Manip
When a manipulator is active, drags of the live portion cause motion of the manipulator. The ManipManager keeps track of which manipulator (if any) is active and takes care of calling the drag() method with the current ray start and direction. The manipulator must keep enough state to understand how it should position and/or rotate itself. NOTE that the base class provides an implementation for this method which you must call at the end of your overriding method.

Overrides:
drag in class Manip

makeInactive

public void makeInactive()
Description copied from class: Manip
When the mouse button is released, makeInactive() is called. The manipulator should reset its state in preparation for the next drag.

Specified by:
makeInactive in class Manip

render

public void render(gl4java.GLFunc gl)
Description copied from class: Manip
Render this Manipulator now using the given OpenGL routines and assuming an OpenGL context is current.

Specified by:
render in class Manip