|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsyn3d.ui.Transformator
public class Transformator
Field Summary | |
---|---|
protected Matrix4f |
drotX
|
protected Matrix4f |
drotY
|
protected float |
eyeDistance
|
protected boolean |
perspective
|
protected int |
pos2DX
|
protected int |
pos2DY
|
protected Matrix4f |
rot
|
protected float |
scaleFactor
|
protected Matrix4f |
trans
|
protected float |
transFactorX
|
protected float |
transFactorY
|
protected Vector3f |
vtrans
|
protected float |
wsize
|
protected Matrix4f |
zoom
|
protected float |
zoomFactor
|
Constructor Summary | |
---|---|
Transformator()
|
Method Summary | |
---|---|
void |
applyTransform()
Hook for subclasses, to apply the current transformation to a relevant object This method is called internally when a change occurs. |
void |
changeProjection()
Turns perspective on an off |
float |
getEyeDistance()
|
int |
getPos2DX()
|
int |
getPos2DY()
|
Matrix4f |
getRot()
|
float |
getScaleFactor()
|
Matrix4f |
getTrans()
|
float |
getTransFactorX()
|
float |
getTranslationFactorY()
|
float |
getWSize()
|
Matrix4f |
getZoom()
|
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 |
setRot(Matrix4f rot)
|
void |
setScaleFactor(float scaleFactor)
|
void |
setTrans(Matrix4f trans)
|
void |
setTransFactorX(float transFactorX)
|
void |
setTranslationFactorY(float transFactorY)
|
void |
setWSize(float wsize)
|
void |
setZoom(Matrix4f zoom)
|
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 |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Matrix4f zoom
protected Matrix4f rot
protected Matrix4f drotX
protected Matrix4f drotY
protected Matrix4f trans
protected Vector3f vtrans
protected int pos2DX
protected int pos2DY
protected boolean perspective
protected float wsize
protected float zoomFactor
protected float scaleFactor
protected float eyeDistance
protected float transFactorX
protected float transFactorY
Constructor Detail |
---|
public Transformator()
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 applyTransform()
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 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 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 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 changeProjection()
public void reset()
public Matrix4f getRot()
public void setRot(Matrix4f rot)
rot
- The rot to set.public Matrix4f getTrans()
public void setTrans(Matrix4f trans)
trans
- The trans to set.public Matrix4f getZoom()
public void setZoom(Matrix4f zoom)
zoom
- The zoom to set.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.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |