|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.javagl.swogl.interaction.ArcballCameraBehavior
public class ArcballCameraBehavior
This class controls the movement of a Camera
in an
Arcball style.
Usually this class will be controlled by an ArcballCameraControl
which internally uses a MouseListener, a MouseMotionListener and a
MouseWheelListener to calling the main public methods accordingly:
startArcballRotate(Point)
when the mouse is pressed to start a rotation
doArcballRotate(Point)
when the mouse is dragged to rotate the camera
startMovement(Point)
when the mouse is pressed to start a movement
doMovement(Point)
when the mouse is moved to move the camera
zoom(float)
when the mouse wheel is rotated to zoom
Constructor Summary | |
---|---|
ArcballCameraBehavior(de.javagl.swogl.scene.View view,
de.javagl.swogl.scene.MutableCamera camera)
Creates a new ArcballCameraBehavior that uses the given View
as the basis for the computation of the arcball, and affects the
given MutableCamera . |
Method Summary | |
---|---|
void |
doArcballRotate(java.awt.Point point)
Called when the arcball rotation continues to the given point |
void |
doMovement(java.awt.Point point)
Called when the movement continues to the given point |
javax.vecmath.Point3f |
getInitialEyePoint()
Returns the initial eye point |
float |
getInitialFovDegrees()
Return the initial FOV, in degrees |
javax.vecmath.Vector3f |
getInitialUpVector()
Returns the initial up vector |
javax.vecmath.Point3f |
getInitialViewPoint()
Returns the initial view point |
void |
reset()
Reset the camera to its initial configuration |
void |
setInitialConfiguration(javax.vecmath.Tuple3f eyePoint,
javax.vecmath.Tuple3f viewPoint,
javax.vecmath.Tuple3f upVector,
float fovDegrees)
Set the configuration that will be established when reset()
is called |
void |
setInitialEyePoint(javax.vecmath.Point3f initialEyePoint)
Set the initial eye point |
void |
setInitialFovDegrees(float initialFovDegrees)
Set the initial FOV, in degrees |
void |
setInitialUpVector(javax.vecmath.Vector3f initialUpVector)
Set the initial up vector |
void |
setInitialViewPoint(javax.vecmath.Point3f initialViewPoint)
Set the initial view point |
void |
startArcballRotate(java.awt.Point point)
Called when the arcball rotation starts at the given point |
void |
startMovement(java.awt.Point point)
Called when the movement starts at the given point |
void |
zoom(float amount)
Zoom by the given amount. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ArcballCameraBehavior(de.javagl.swogl.scene.View view, de.javagl.swogl.scene.MutableCamera camera)
View
as the basis for the computation of the arcball, and affects the
given MutableCamera
. The initial configuration of this
behavior (which will be established upon a call to reset()
)
will be obtained from the current configuration of the given
camera.
view
- The viewcamera
- The camera
java.lang.NullPointerException
- if either the view or the camera
is null
Method Detail |
---|
public void setInitialConfiguration(javax.vecmath.Tuple3f eyePoint, javax.vecmath.Tuple3f viewPoint, javax.vecmath.Tuple3f upVector, float fovDegrees)
reset()
is called
eyePoint
- The initial eye pointviewPoint
- The initial view pointupVector
- The initial up vectorfovDegrees
- The FOV in degreespublic javax.vecmath.Point3f getInitialEyePoint()
public void setInitialEyePoint(javax.vecmath.Point3f initialEyePoint)
initialEyePoint
- The initial eye pointpublic javax.vecmath.Point3f getInitialViewPoint()
public void setInitialViewPoint(javax.vecmath.Point3f initialViewPoint)
initialViewPoint
- The initial view pointpublic javax.vecmath.Vector3f getInitialUpVector()
public void setInitialUpVector(javax.vecmath.Vector3f initialUpVector)
initialUpVector
- The initial up vectorpublic float getInitialFovDegrees()
public void setInitialFovDegrees(float initialFovDegrees)
initialFovDegrees
- The initial FOVpublic void reset()
public void startArcballRotate(java.awt.Point point)
point
- The point where the arcball rotation starts,
in screen coordinatespublic void doArcballRotate(java.awt.Point point)
point
- The current mouse position, screen coordinatespublic void startMovement(java.awt.Point point)
point
- The point where the movement starts, in screen coordinatespublic void doMovement(java.awt.Point point)
point
- The current mouse position, screen coordinatespublic void zoom(float amount)
amount
- The zoom amount
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |