peasy
Class PeasyCam

java.lang.Object
  extended by peasy.PeasyCam

public class PeasyCam
extends java.lang.Object

Author:
Jonathan Feinberg

Nested Class Summary
 class PeasyCam.AbstractInterp
           
 
Field Summary
 java.lang.String VERSION
           
 
Constructor Summary
PeasyCam(processing.core.PApplet parent, double distance)
           
PeasyCam(processing.core.PApplet parent, double lookAtX, double lookAtY, double lookAtZ, double distance)
           
 
Method Summary
 void beginHUD()
          Thanks to A.W.
 void endHUD()
           
 void feed()
           
 double getDistance()
           
 float[] getLookAt()
           
 PeasyDragHandler getPanDragHandler()
           
 float[] getPosition()
          Where is the PeasyCam in world space?
 PeasyDragHandler getRotateDragHandler()
           
 float[] getRotations()
          Express the current camera rotation as an equivalent series of world rotations, in X, Y, Z order.
 CameraState getState()
           
 PeasyWheelHandler getWheelHandler()
           
 double getWheelScale()
           
 PeasyDragHandler getZoomDragHandler()
           
 PeasyWheelHandler getZoomWheelHandler()
           
 boolean isActive()
           
 void lookAt(double x, double y, double z)
           
 void lookAt(double x, double y, double z, double distance)
           
 void lookAt(double x, double y, double z, double distance, long animationTimeMillis)
           
 void lookAt(double x, double y, double z, long animationTimeMillis)
           
 void pan(double dx, double dy)
           
 void reset()
           
 void reset(long animationTimeInMillis)
           
 void rotateX(double angle)
           
 void rotateY(double angle)
           
 void rotateZ(double angle)
           
 void setActive(boolean active)
           
 void setCenterDragHandler(PeasyDragHandler handler)
           
 void setDistance(double newDistance)
           
 void setDistance(double newDistance, long animationTimeMillis)
           
 void setFreeRotationMode()
          Permit arbitrary rotation.
 void setLeftDragHandler(PeasyDragHandler handler)
           
 void setMaximumDistance(double maximumDistance)
           
 void setMinimumDistance(double minimumDistance)
           
 void setMouseControlled(boolean isMouseControlled)
          Deprecated. use setActive(boolean)
 void setPitchRotationMode()
          Only permit pitch.
 void setResetOnDoubleClick(boolean resetOnDoubleClick)
           
 void setRightDragHandler(PeasyDragHandler handler)
           
 void setRollRotationMode()
          Only permit roll.
 void setRotations(double pitch, double yaw, double roll)
           
 void setState(CameraState state)
           
 void setState(CameraState state, long animationTimeMillis)
           
 void setSuppressRollRotationMode()
          Only suppress roll.
 void setWheelHandler(PeasyWheelHandler wheelHandler)
           
 void setWheelScale(double wheelScale)
           
 void setYawRotationMode()
          Only permit yaw.
 java.lang.String version()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VERSION

public final java.lang.String VERSION
See Also:
Constant Field Values
Constructor Detail

PeasyCam

public PeasyCam(processing.core.PApplet parent,
                double distance)

PeasyCam

public PeasyCam(processing.core.PApplet parent,
                double lookAtX,
                double lookAtY,
                double lookAtZ,
                double distance)
Method Detail

setActive

public void setActive(boolean active)

isActive

public boolean isActive()

setMouseControlled

@Deprecated
public void setMouseControlled(boolean isMouseControlled)
Deprecated. use setActive(boolean)

Turn on or off default mouse-handling behavior:

left-drag rotate camera around look-at point
center-drag pan camera (change look-at point)
right-drag zoom
wheel zoom

Parameters:
isMouseControlled -

getWheelScale

public double getWheelScale()

setWheelScale

public void setWheelScale(double wheelScale)

getPanDragHandler

public PeasyDragHandler getPanDragHandler()

getRotateDragHandler

public PeasyDragHandler getRotateDragHandler()

getZoomDragHandler

public PeasyDragHandler getZoomDragHandler()

getZoomWheelHandler

public PeasyWheelHandler getZoomWheelHandler()

setLeftDragHandler

public void setLeftDragHandler(PeasyDragHandler handler)

setCenterDragHandler

public void setCenterDragHandler(PeasyDragHandler handler)

setRightDragHandler

public void setRightDragHandler(PeasyDragHandler handler)

getWheelHandler

public PeasyWheelHandler getWheelHandler()

setWheelHandler

public void setWheelHandler(PeasyWheelHandler wheelHandler)

version

public java.lang.String version()

getDistance

public double getDistance()

setDistance

public void setDistance(double newDistance)

setDistance

public void setDistance(double newDistance,
                        long animationTimeMillis)

getLookAt

public float[] getLookAt()

lookAt

public void lookAt(double x,
                   double y,
                   double z)

lookAt

public void lookAt(double x,
                   double y,
                   double z,
                   double distance)

lookAt

public void lookAt(double x,
                   double y,
                   double z,
                   long animationTimeMillis)

lookAt

public void lookAt(double x,
                   double y,
                   double z,
                   double distance,
                   long animationTimeMillis)

feed

public void feed()

getPosition

public float[] getPosition()
Where is the PeasyCam in world space?

Returns:
float[]{x,y,z}

reset

public void reset()

reset

public void reset(long animationTimeInMillis)

pan

public void pan(double dx,
                double dy)

rotateX

public void rotateX(double angle)

rotateY

public void rotateY(double angle)

rotateZ

public void rotateZ(double angle)

getState

public CameraState getState()

setFreeRotationMode

public void setFreeRotationMode()
Permit arbitrary rotation. (Default mode.)


setYawRotationMode

public void setYawRotationMode()
Only permit yaw.


setPitchRotationMode

public void setPitchRotationMode()
Only permit pitch.


setRollRotationMode

public void setRollRotationMode()
Only permit roll.


setSuppressRollRotationMode

public void setSuppressRollRotationMode()
Only suppress roll.


setMinimumDistance

public void setMinimumDistance(double minimumDistance)

setMaximumDistance

public void setMaximumDistance(double maximumDistance)

setResetOnDoubleClick

public void setResetOnDoubleClick(boolean resetOnDoubleClick)

setState

public void setState(CameraState state)

setState

public void setState(CameraState state,
                     long animationTimeMillis)

setRotations

public void setRotations(double pitch,
                         double yaw,
                         double roll)

getRotations

public float[] getRotations()
Express the current camera rotation as an equivalent series of world rotations, in X, Y, Z order. This is useful when, for example, you wish to orient text towards the camera at all times, as in
float[] rotations = cam.getRotations(rotations);
rotateX(rotations[0]);
rotateY(rotations[1]);
rotateZ(rotations[2]);
text("Here I am!", 0, 0, 0);


beginHUD

public void beginHUD()
Thanks to A.W. Martin for the code to do HUD


endHUD

public void endHUD()


processing library peasycam by Jonathan Feinberg. (c) 2011