|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjsynoptic.plugins.java3d.ViewTransform
public class ViewTransform
Field Summary | |
---|---|
static int |
FLY_BY_MODE
In fly-by mode, the user can freely move in the scene. |
static int |
ROTATION_MODE
In rotation mode, the user rotates the whole scene and can zoom in or out. |
Constructor Summary | |
---|---|
ViewTransform(ViewingPlatform viewingPlatform)
|
Method Summary | |
---|---|
void |
applyTransform()
|
void |
autoZoom()
Auto zooms the scene out of all objects |
void |
changeProjection()
Turns perspective on an off |
java.lang.Object |
clone()
|
float |
getEyeDistance()
|
int |
getPos2DX()
|
int |
getPos2DY()
|
float |
getScaleFactor()
|
protected float |
getSceneSize()
Used for auto-zooming to englobe the scene |
float |
getTransFactorX()
|
float |
getTranslationFactorY()
|
int |
getViewingMode()
|
float |
getWSize()
|
float |
getZoomFactor()
|
void |
init2DPosition(int posX,
int posY)
Initialize 2D rotation algorithm with the current position as origin. |
boolean |
isPerspective()
|
void |
reset()
Reset all values to default |
void |
rotate2D(int newX,
int newY)
Does a rotation of the scene according to moves in a 2D coordinate system. |
void |
rotate2D(int newX,
int newY,
boolean inverse)
Does a rotation of the scene according to moves in a 2D coordinate system. |
void |
setEyeDistance(float eyeDistance)
|
void |
setPerspective(boolean p)
|
void |
setPos2DX(int pos2DX)
|
void |
setPos2DY(int pos2DY)
|
void |
setScaleFactor(float scaleFactor)
|
void |
setTransFactorX(float transFactorX)
|
void |
setTranslationFactorY(float transFactorY)
|
void |
setViewingMode(int viewingMode)
|
void |
setWSize(float wsize)
|
void |
setZoomFactor(float zoomFactor)
|
void |
translate2D(int newX,
int newY)
Does a translation of the scene according to moves in a 2D coordinate system. |
void |
updateTranslateMatrix()
Updates the translation matrix with the translation factors previously specified This is intentionally a separate function, so that it is possible to do multiple factor modifications, in both directions, then finally update the matrix at the end. |
void |
updateZoomMatrix()
Updates the zoom matrix with the translation factors previously specified This is intentionally a separate function, so that it is possible to do multiple factor modifications, then finally update the matrix at the end. |
void |
zoom(int zoomIncrement)
Zooms in or out of the scene according to the increment. |
void |
zoom2D(int newX,
int newY)
Uses the 2D increments in position to compute a zoom factor, then zooms the scene accordingly. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int ROTATION_MODE
public static final int FLY_BY_MODE
Constructor Detail |
---|
public ViewTransform(ViewingPlatform viewingPlatform)
Method Detail |
---|
public float getEyeDistance()
public void setEyeDistance(float eyeDistance)
public float getScaleFactor()
public void setScaleFactor(float scaleFactor)
public float getTransFactorX()
public void setTransFactorX(float transFactorX)
public float getTranslationFactorY()
public void setTranslationFactorY(float transFactorY)
public float getWSize()
public void setWSize(float wsize)
public float getZoomFactor()
public void setZoomFactor(float zoomFactor)
public void setPerspective(boolean p)
public boolean isPerspective()
public void updateTranslateMatrix()
public void updateZoomMatrix()
public void init2DPosition(int posX, int posY)
public void rotate2D(int newX, int newY)
newX
- The new X position in 2D, typically a mouse positionnewY
- The new Y position in 2D, typically a mouse positionpublic void rotate2D(int newX, int newY, boolean inverse)
newX
- The new X position in 2D, typically a mouse positionnewY
- The new Y position in 2D, typically a mouse positioninverse
- Inverse the direction of the rotation if true. This is used
ROTATION_MODE viewing mode for the scene, in which case the
scene rotates according to the mouse => in fact, the camera
rotates in the opposite direction. => default is truepublic void changeProjection()
public void reset()
public int getPos2DX()
public void setPos2DX(int pos2DX)
pos2DX
- The pos2DX to set.public int getPos2DY()
public void setPos2DY(int pos2DY)
pos2DY
- The pos2DY to set.public int getViewingMode()
public void setViewingMode(int viewingMode)
viewingMode
- The viewingMode to set.public void autoZoom()
protected float getSceneSize()
public void zoom(int zoomIncrement)
zoomIncrement
- A value typically 1 or -1, but which can be greater for fast
zooms. Positive values zoom in, negative values zoom out.public void zoom2D(int newX, int newY)
newX
- The new X position in 2D, typically a mouse positionnewY
- The new Y position in 2D, typically a mouse positionpublic void translate2D(int newX, int newY)
newX
- The new X position in 2D, typically a mouse positionnewY
- The new Y position in 2D, typically a mouse positionpublic void applyTransform()
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |