|
JavaView® v2.12 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--jv.object.PsObject
|
+--jv.viewer.PvCamera
Camera for PvDisplay. Four different projection types.
Handled by PvDisplay.
If camera info panel is showing, then it is updated when geometry is rotated. On slow machines just switch the visible panel to stop the panel update.
PvDisplay, Serialized Form| Field Summary | |
PdMatrix |
m_trans
|
PdMatrix |
m_transInv
|
PdMatrix |
m_view
|
PdMatrix |
m_viewInv
|
| Fields inherited from class jv.object.PsObject |
HAS_CONFIG_PANEL, HAS_INFO_PANEL, HAS_MATERIAL_PANEL, HAS_TEXTURE_PANEL, INSPECTOR_INFO, INSPECTOR_INFO_EXT, IS_DELETED, IS_FIXED, IS_SELECTED, IS_USED, NUM_TAGS |
| Constructor Summary | |
PvCamera(PvDisplay display,
int projMode)
|
|
| Method Summary | |
void |
fit(double diameter)
Fit object with given diameter into current display window. |
PdVector[] |
getBounds()
Get transformed bounding box used in clipping. |
double |
getDist()
Get distance of camera position from point of interest in world coordinates. |
double |
getFarClip()
Get distance of the far clipping plane. |
double |
getFieldOfView()
Get opening angle of camera. |
PdVector |
getInterest()
Get position at which camera is directed, i.e. the point of interest. |
double |
getNearClip()
Get distance of the near clipping plane. |
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. |
PdVector |
getUpVector()
Get up vector as second row of viewing matrix divided by scaling factor. |
PdVector |
getViewDir()
Get normalized viewing direction as the vector pointing from the camera to its interest. |
void |
init()
Initializes and resets current camera. |
boolean |
isEnabledClip()
Determine whether horizontal clipping is enabled. |
void |
setDist(double newDist)
Set distance of camera position from point of interest in world coordinates. |
void |
setEnabledClip(boolean flag)
Enable horizontal clipping. |
void |
setFarClip(double dist)
Get distance of far clipping plane. |
void |
setFieldOfView(double angle)
Set opening angle of camera. |
void |
setInterest(PdVector pos)
Set location at which camera is directed, i.e. the point of interest. |
void |
setNearClip(double dist)
Get distance of the near clipping plane. |
void |
setPosition(PdVector pos)
Set position of camera in world coordinates. |
void |
setProjectionMode(int mode)
Set projection mode of the camera, for example, perspective, xy-projection etc. |
void |
setRoll(double roll)
Set angle which camera is rotated around viewing direction against default position. |
void |
setScale(double newScale)
Set zoom factor of camera. |
void |
setUpVector(PdVector up)
Set normalized up vector of camera in world coordinates. |
void |
setViewDir(PdVector pos)
Set viewing direction as the vector pointing from the camera to its interest. |
boolean |
update(java.lang.Object event)
event == this : geometry has changed by itself without widget event, therefore somewhere in a superclass the infoPanel must be updated. call: super.update(event, e.g. this) event == null : geometry has change by widget event which has been handled call: super.update(null) event == else : we must handle the event here or pass it to superclass. |
| Methods inherited from class jv.object.PsObject |
addInspector, addUpdateListener, assureInspector, clearTag, clone, clone, clone, copy, getFather, getInfoPanel, getInspector, getName, getNumObjects, hasInspector, hasTag, hasUpdateListener, instanceOf, instanceOf, removeInspector, removeUpdateListener, setName, setParent, setTag, toString, updatePanels |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface jv.object.PsUpdateIf |
getFather, getName, setParent |
| Field Detail |
public PdMatrix m_view
public PdMatrix m_viewInv
public PdMatrix m_trans
public PdMatrix m_transInv
| Constructor Detail |
public PvCamera(PvDisplay display,
int projMode)
| Method Detail |
public void init()
init in class PsObjectpublic boolean update(java.lang.Object event)
update in interface PsUpdateIfupdate in class PsObjectjv.object.PsUpdateIfevent - carries a lot of informationPsObject,
PsUpdateIf.getFather(),
PsUpdateIf.setParent(PsUpdateIf)public int getProjectionMode()
PvDisplayIf#CAMERA_ORTHO_XY.getProjectionMode in interface PvCameraIfPvDisplayIfpublic void setProjectionMode(int mode)
PvDisplayIf#CAMERA_ORTHO_XY.setProjectionMode in interface PvCameraIfnew - projection modePvDisplayIfpublic boolean isEnabledClip()
isEnabledClip in interface PvCameraIfpublic void setEnabledClip(boolean flag)
setEnabledClip in interface PvCameraIfpublic double getNearClip()
getNearClip in interface PvCameraIfpublic void setNearClip(double dist)
setNearClip in interface PvCameraIfdist - positive distance of the near clip planepublic double getFarClip()
getFarClip in interface PvCameraIfpublic void setFarClip(double dist)
setFarClip in interface PvCameraIfdist - positive distance of the far clip planepublic PdVector getViewDir()
Internally the viewing direction is the negative of third row of the viewing matrix divided by the scaling factor.
viewDir = -view[2][.] / getScale().
getViewDir in interface PvCameraIfpublic void setViewDir(PdVector pos)
setViewDir in interface PvCameraIfviewing - direction in world coordinatespublic double getDist()
getDist in interface PvCameraIfgetScale()public void setDist(double newDist)
factor=newDist/currDist.setDist in interface PvCameraIfdistance - of camera to interest in world coordinates.setScale(double)public double getScale()
getScale in interface PvCameraIfgetDist()public void setScale(double newScale)
setScale in interface PvCameraIfzoom - factor of camera.setDist(double)public double getFieldOfView()
getFieldOfView in interface PvCameraIfsetFieldOfView(double)public void setFieldOfView(double angle)
setFieldOfView in interface PvCameraIfangle - in (0,180)getFieldOfView()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 looks down the negative z-axis and the positive y-axis is showing upward.
getRoll in interface PvCameraIfsetRoll(double)public void setRoll(double roll)
setRoll in interface PvCameraIfangle - in (-pi,pi)getRoll()public PdVector getInterest()
interest = viewInv[.][3]
getInterest in interface PvCameraIfpublic void setInterest(PdVector pos)
This behaviour results from the steering inside the camera panel where a user may change the interest, viewing direction and distance. User who want to set camera position and interest are advised either to first set the interest and then the position, or to set the viewing direction and the interest.
setInterest in interface PvCameraIfpos - 3d-coordinates of interest in world coordinates.public PdVector getPosition()
position = interest - dist*viewDir.
getPosition in interface PvCameraIfpublic void setPosition(PdVector pos)
position = interest - dist*viewDir.
setPosition in interface PvCameraIfpos - 3d-position of camera in world coordinates.public PdVector getUpVector()
upDir = -view[1][.] / getScale().
getUpVector in interface PvCameraIfpublic void setUpVector(PdVector up)
setUpVector in interface PvCameraIfnormalized - up vector of camera in world coordinates.public void fit(double diameter)
public PdVector[] getBounds()
|
JavaView® v2.12 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||