|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.ObjectSGCamera.SGCamera
public class SGCamera
| Field Summary | |
|---|---|
float |
aspect
|
static int |
DOLLY
|
Tuple.Tuple3f |
forward
|
float |
fov
Field of view of the camera in radians |
protected float |
maxPhi
upper bounds on camera angle |
protected float |
minPhi
|
static int |
MOUSELOOK
|
static int |
MOVE
|
static int |
ORBIT
|
protected processing.core.PApplet |
parent
|
float |
phi
|
Tuple.Tuple3f |
pos
|
float |
rho
|
Tuple.Tuple3f |
right
|
Tuple.Tuple3f |
target
|
float |
theta
|
static int |
UNBOUND
|
Tuple.Tuple3f |
up
|
static int |
WSAD
|
static int |
ZOOM
|
| Constructor Summary | |
|---|---|
SGCamera(processing.core.PApplet parent,
float cx,
float cy,
float cz,
float tx,
float ty,
float tz)
Creates the camera |
|
SGCamera(processing.core.PApplet parent,
float cx,
float cy,
float cz,
float tx,
float ty,
float tz,
float ux,
float uy,
float uz,
int leftMouseMode,
int rightMouseMode)
|
|
SGCamera(processing.core.PApplet parent,
float cx,
float cy,
float cz,
float tx,
float ty,
float tz,
int leftMouseMode,
int rightMouseMode)
Create the camera and assign mouse behaviors. |
|
| Method Summary | |
|---|---|
void |
dolly(float amt)
|
void |
feed()
|
void |
forward(float amt)
|
int |
getKeyRegistered()
|
Tuple.Tuple3f |
getPos()
|
Tuple.Tuple3f |
getRay(float curX,
float curY)
Give the ray direction from the origin through the pixel on the camera view plane. |
void |
lookAt(float tx,
float ty,
float tz)
|
void |
lookZ(float amt)
|
void |
mouseEvent(java.awt.event.MouseEvent e)
Handles mouseEvents. |
void |
render(float size)
|
void |
right(float amt)
|
void |
roll(float amt)
This is broken, don't use it. |
void |
rotY(float rads)
|
void |
setFOV(float fov)
Set the camera FOV |
void |
setMouseMode(int mouseButton,
int mode)
Tell camera how to handle mouse drag input |
void |
setPosition(float x,
float y,
float z)
Set the camera position |
void |
setTarget(float x,
float y,
float z)
Set the camera position |
void |
setTheta(float theta)
|
void |
setUpVector()
|
void |
setUpVector(float ux,
float uy,
float uz)
|
void |
setVerticalLimits(float minPhi,
float maxPhi)
Sets the vertical bounds of the camera's motion. |
void |
translate(float x,
float y,
float z)
|
void |
zoom(float amt)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int UNBOUND
public static final int ORBIT
public static final int MOUSELOOK
public static final int ZOOM
public static final int MOVE
public static final int WSAD
public static final int DOLLY
public Tuple.Tuple3f pos
public Tuple.Tuple3f target
public Tuple.Tuple3f up
public Tuple.Tuple3f right
public Tuple.Tuple3f forward
public float rho
public float phi
public float theta
protected float maxPhi
protected float minPhi
protected processing.core.PApplet parent
public float fov
public float aspect
| Constructor Detail |
|---|
public SGCamera(processing.core.PApplet parent,
float cx,
float cy,
float cz,
float tx,
float ty,
float tz)
parent - the containing processing PAppletcx - camera x positioncy - camera y positioncz - camera z positiontx - target x positionty - target y positiontz - target z position
public SGCamera(processing.core.PApplet parent,
float cx,
float cy,
float cz,
float tx,
float ty,
float tz,
int leftMouseMode,
int rightMouseMode)
parent - the containing processing PAppletcx - camera x positioncy - camera y positioncz - camera z positiontx - target x positionty - target y positiontz - target z positionleftMouseMode - Assigns mouse behaviour to the left button dragrightMouseMode - Assigns mouse behaviour to the right button drag
public SGCamera(processing.core.PApplet parent,
float cx,
float cy,
float cz,
float tx,
float ty,
float tz,
float ux,
float uy,
float uz,
int leftMouseMode,
int rightMouseMode)
| Method Detail |
|---|
public int getKeyRegistered()
public Tuple.Tuple3f getPos()
public void setVerticalLimits(float minPhi,
float maxPhi)
minPhi - maxPhi -
public Tuple.Tuple3f getRay(float curX,
float curY)
curX - X pixel coordinatecurY - Y pixel coordinate
public void setUpVector(float ux,
float uy,
float uz)
public void setUpVector()
public void roll(float amt)
public void setTarget(float x,
float y,
float z)
public void setPosition(float x,
float y,
float z)
public void setTheta(float theta)
public void lookAt(float tx,
float ty,
float tz)
public void feed()
public void lookZ(float amt)
public void rotY(float rads)
public void translate(float x,
float y,
float z)
public void forward(float amt)
public void right(float amt)
public void dolly(float amt)
public void zoom(float amt)
public void setFOV(float fov)
fov - desired camera FOV in radians
public void setMouseMode(int mouseButton,
int mode)
mouseButton - which button to bindmode - action to bind to button. Default is UNBOUND, or nothing.public void mouseEvent(java.awt.event.MouseEvent e)
e - public void render(float size)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||