Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## proscene
Class PSInteractiveCameraFrame

    java.lang.Object
      proscene.PSFrame
          proscene.PSInteractiveFrame
              proscene.PSInteractiveCameraFrame

All Implemented Interfaces:
  java.lang.Cloneable, PSMouseGrabber

    public class PSInteractiveCameraFrame

extends PSInteractiveFrame

The PSInteractiveCameraFrame class represents a PSInteractiveFrame with Camera specific mouse bindings.

A PSInteractiveCameraFrame is a specialization of a PSInteractiveFrame, designed to be set as the `PSCamera.frame()`. Mouse motions are basically interpreted in a negated way: when the mouse goes to the right, the PSInteractiveFrame translation goes to the right, while the PSInteractiveCameraCameraFrame has to go to the left, so that the scene seems to move to the right.

A PSInteractiveCameraFrame rotates around its `revolveAroundPoint()`, which corresponds to the associated `PSCamera.revolveAroundPoint()`.

A PSInteractiveCameraFrame can also "fly" in the scene. It basically moves forward, and turns according to the mouse motion. See `flySpeed()`, `flyUpVector()` and the `PScene.MouseAction.MOVE_FORWARD` and `PScene.MouseAction.MOVE_BACKWARD`.

Nested Class Summary

Nested classes/interfaces inherited from class proscene.PSInteractiveFrame
`PSInteractiveFrame.CoordinateSystemConvention`

Field Summary

Fields inherited from interface proscene.PSMouseGrabber
`MouseGrabberPool`

Constructor Summary
`PSInteractiveCameraFrame()` Default constructor.

Method Summary
`PSInteractiveCameraFrame` | `clone()` Implementation of the clone method.
`void` | `flyUpdate()` Called for continuous frame motion in fly mode (see PSScene.MOVE_FORWARD).
`processing.core.PVector` | `flyUpVector()` Returns the up vector used in fly mode, expressed in the world coordinate system.
`void` | `mouseMoveEvent(java.awt.event.MouseEvent event, PSCamera camera)` Overloading of `PSInteractiveFrame.mouseMoveEvent(MouseEvent, PSCamera)`.
`void` | `mouseReleaseEvent(java.awt.event.MouseEvent event, PSCamera camera)` Overloading of `PSInteractiveFrame.mouseReleaseEvent(MouseEvent, PSCamera)`.
`void` | `mouseWheelEvent(java.awt.event.MouseWheelEvent event, PSCamera camera)` Overloading of `PSInteractiveFrame.mouseWheelEvent(MouseWheelEvent, PSCamera)`.
`processing.core.PVector` | `revolveAroundPoint()` Returns the point the PSInteractiveCameraFrame revolves around when rotated.
`void` | `setFlySpeed(float speed)` Sets the flySpeed(), defined in processing scene units.
`void` | `setFlyUpVector(processing.core.PVector up)` Sets the `flyUpVector()`, defined in the world coordinate system.
`void` | `setRevolveAroundPoint(processing.core.PVector revolveAroundPoint)` Sets the `revolveAroundPoint()`, defined in the world coordinate system.
`void` | `spin()` Overloading of `PSInteractiveFrame.spin()`.

Methods inherited from class proscene.PSInteractiveFrame
`addInMouseGrabberPool, checkIfGrabsMouse, clearMouseGrabberPool, coordinateSystemConvention, getMouseGrabberPool, grabsMouse, isInMouseGrabberPool, isSpinning, mouseDoubleClickEvent, mouseGrabberPool, mousePressEvent, removeFromMouseGrabberPool, rotationSensitivity, setCoordinateSystemConvention, setGrabsMouse, setRotationSensitivity, setSpinningQuaternion, setSpinningSensitivity, setTranslationSensitivity, setWheelSensitivity, spinningQuaternion, spinningSensitivity, startSpinning, stopSpinning, translationSensitivity`

Methods inherited from class proscene.PSFrame
`alignWithFrame, alignWithFrame, alignWithFrame, alignWithFrame, applyTransformation, constraint, coordinatesOf, coordinatesOfFrom, coordinatesOfIn, copy, fromMatrix, inverse, inverseCoordinatesOf, inverseTransformOf, localCoordinatesOf, localInverseCoordinatesOf, localInverseTransformOf, localTransformOf, matrix, orientation, position, projectOnLine, referenceFrame, rotate, rotate, rotateAroundPoint, rotateAroundPointModifyingArgument, rotateModifyingArgument, rotation, setConstraint, setOrientation, setOrientation, setOrientationWithConstraint, setPosition, setPosition, setPositionWithConstraint, setReferenceFrame, setRotation, setRotation, setRotationWithConstraint, settingAsReferenceFrameWillCreateALoop, setTranslation, setTranslation, setTranslationWithConstraint, transformOf, transformOfFrom, transformOfIn, translate, translate, translateModifyingArgument, translation, worldInverse, worldMatrix`

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### PSInteractiveCameraFrame

    public PSInteractiveCameraFrame()

  Default constructor.

  `flySpeed()` is set to 0.0 and `flyUpVector()` is (0,1,0). The `revolveAroundPoint()` is set to (0,0,0).

  Attention: Created object is `PSInteractiveFrame.removeFromMouseGrabberPool()`.

Method Detail

### clone

    public PSInteractiveCameraFrame clone()

  Implementation of the clone method.

  Calls `PSInteractiveFrame.clone()` and makes a deep copy of the remaining object attributes.

  Overrides:
    `clone` in class `PSInteractiveFrame`
  See Also:
    `PSInteractiveFrame.clone()`

### spin

    public void spin()

  Overloading of `PSInteractiveFrame.spin()`.

  Rotates the PSInteractiveCameraFrame around its #revolveAroundPoint() instead of its origin.

  Overrides:
    `spin` in class `PSInteractiveFrame`

### setFlySpeed

    public void setFlySpeed(float speed)

  Sets the flySpeed(), defined in processing scene units.

  Default value is 0.0, but it is modified according to the `PScene.sceneRadius()` when the PSInteractiveCameraFrame is set as the `PSCamera.frame()`.

### flyUpVector

    public processing.core.PVector flyUpVector()

  Returns the up vector used in fly mode, expressed in the world coordinate system.

  Fly mode corresponds to the `PScene.MouseAction.MOVE_FORWARD` and `PScene.MouseAction.MOVE_BACKWARD` proscene.PScene.MouseAction bindings. In these modes, horizontal displacements of the mouse rotate the PSInteractiveCameraFrame around this vector. Vertical displacements rotate always around the PSCamera `X` axis.

  Default value is (0,1,0), but it is updated by the PSCamera when set as its `PSCamera.frame()`. `PSCamera.setOrientation(PSQuaternion)` and `PSCamera.setUpVector(PVector)` modify this value and should be used instead.

### setFlyUpVector

    public void setFlyUpVector(processing.core.PVector up)

  Sets the `flyUpVector()`, defined in the world coordinate system.

  Default value is (0,1,0), but it is updated by the PSCamera when set as its `PSCamera.frame()`. Use `PSCamera.setUpVector(PVector)` instead in that case.

### revolveAroundPoint

    public processing.core.PVector revolveAroundPoint()

  Returns the point the PSInteractiveCameraFrame revolves around when rotated.

  It is defined in the world coordinate system. Default value is (0,0,0).

  When the PSInteractiveCameraFrame is associated to a PSCamera, `PSCamera.revolveAroundPoint()` also returns this value.

### flyUpdate

    public void flyUpdate()

  Called for continuous frame motion in fly mode (see PSScene.MOVE_FORWARD).

### setRevolveAroundPoint

    public void setRevolveAroundPoint(processing.core.PVector revolveAroundPoint)

  Sets the `revolveAroundPoint()`, defined in the world coordinate system.

### mouseMoveEvent

    public void mouseMoveEvent(java.awt.event.MouseEvent event,
                               PSCamera camera)

  Overloading of `PSInteractiveFrame.mouseMoveEvent(MouseEvent, PSCamera)`.

  Motion depends on mouse binding. The resulting displacements are basically inverted from those of an PSInteractiveFrame.

  Specified by:
    `mouseMoveEvent` in interface `PSMouseGrabber`
  Overrides:
    `mouseMoveEvent` in class `PSInteractiveFrame`
  See Also:
    `PSCamera.screenWidth()`, `PSCamera.screenHeight()`, `PSCamera.fieldOfView()`

### mouseReleaseEvent

    public void mouseReleaseEvent(java.awt.event.MouseEvent event,
                                  PSCamera camera)

  Overloading of `PSInteractiveFrame.mouseReleaseEvent(MouseEvent, PSCamera)`.

  Specified by:
    `mouseReleaseEvent` in interface `PSMouseGrabber`
  Overrides:
    `mouseReleaseEvent` in class `PSInteractiveFrame`
  See Also:
    `PSInteractiveFrame.startSpinning(int)`, `PSInteractiveFrame.isSpinning()`

### mouseWheelEvent

    public void mouseWheelEvent(java.awt.event.MouseWheelEvent event,
                                PSCamera camera)

  Overloading of `PSInteractiveFrame.mouseWheelEvent(MouseWheelEvent, PSCamera)`.

  The wheel behavior depends on the wheel binded action. Current possible actions are ZOOM, MOVE_FORWARD, MOVE_BACKWARD. ZOOM speed depends on #wheelSensitivity() MOVE_FORWARD and MOVE_BACKWARD depend on #flySpeed().

  Specified by:
    `mouseWheelEvent` in interface `PSMouseGrabber`
  Overrides:
    `mouseWheelEvent` in class `PSInteractiveFrame`
  See Also:
    `PSInteractiveFrame.setWheelSensitivity(float)`

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

processing library glgraphics by Andres Colubri. (c) 2008