public final class PvCameraEvent
extends java.lang.Object
implements java.io.Serializable
PvPickListenerIf
,
PvCameraIf
,
PvDisplayIf
,
Serialized FormConstructor and Description |
---|
PvCameraEvent(PvDisplayIf disp,
int dim)
Constructor with dimension of scene shown in display, usually dim=3.
|
Modifier and Type | Method and Description |
---|---|
int |
getDimOfVertex()
Get dimension of scene position of cursor in world coordinate of scene in display.
|
PdVector |
getInterest()
Get position at which camera is directed, i.e. the point of interest.
|
java.awt.Point |
getLocation()
Get position of cursor in pixel coordinates of drawing canvas of event.
|
PdVector |
getPosition()
Get position of camera in world coordinates.
|
int |
getProjectionMode()
Get projection mode of the camera, for example, perspective, xy-projection etc.
|
double |
getRoll()
Get angle which camera is rotated around viewing direction against default position.
|
double |
getScale()
Get zoom factor of camera.
|
PvDisplayIf |
getSource()
Get source display where this event occurred.
|
PdVector |
getUpVector()
Get up vector as second row of viewing matrix divided by scaling factor.
|
PdVector |
getVertex()
Get position of cursor in world coordinate of scene in display.
|
PdVector |
getViewDir()
Get normalized viewing direction as the vector pointing from the camera
to its interest.
|
void |
setCamera(PvCameraIf camera)
Assign current camera of display when this event occurred.
|
void |
setLocation(java.awt.Point pos)
Set position of cursor in pixel coordinates of drawing canvas of event.
|
void |
setVertex(PdVector vertex)
Set position of cursor in world coordinate of scene in display.
|
public PvCameraEvent(PvDisplayIf disp, int dim)
disp
- Display where this event occurreddim
- Dimension of world coordinates in scenepublic PvDisplayIf getSource()
public int getDimOfVertex()
public java.awt.Point getLocation()
public void setLocation(java.awt.Point pos)
pos
- Location of mouse cursor in 2d pixel coordinatespublic PdVector getVertex()
public void setVertex(PdVector vertex)
vertex
- World coordinates of mouse position in scene.public void setCamera(PvCameraIf camera)
camera
- Active camera of display to be queried for information.public int getProjectionMode()
PvCameraIf#CAMERA_ORTHO_XY
.PvDisplayIf
public double getScale()
public double getRoll()
Mathematically, the roll is the angle between the two planes p1=(viewDir, defaultUpVector) and p2=(viewDir, upVector). The defaultUpVector depends on the projection mode, in xy-projection mode we have defaultUpVector=(0,1,0) since camera look down the negative z-axis and the positive y-axis is showing upward.
public PdVector getInterest()
public PdVector getPosition()
public PdVector getViewDir()
public PdVector getUpVector()
"