|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jme3.input.FlyByCamera
public class FlyByCamera
A first person view camera controller. After creation, you must register the camera controller with the dispatcher using #registerWithDispatcher(). Controls: - Move the mouse to rotate the camera - Mouse wheel for zooming in or out - WASD keys for moving forward/backward and strafing - QZ keys raise or lower the camera
Field Summary | |
---|---|
protected Camera |
cam
|
protected boolean |
canRotate
|
protected boolean |
dragToRotate
|
protected boolean |
enabled
|
protected Vector3f |
initialUpVec
|
protected InputManager |
inputManager
|
protected MotionAllowedListener |
motionAllowed
|
protected float |
moveSpeed
|
protected float |
rotationSpeed
|
Constructor Summary | |
---|---|
FlyByCamera(Camera cam)
Creates a new FlyByCamera to control the given Camera object. |
Method Summary | |
---|---|
float |
getMoveSpeed()
Gets the move speed. |
float |
getRotationSpeed()
Gets the move speed. |
boolean |
isDragToRotate()
|
boolean |
isEnabled()
|
protected void |
moveCamera(float value,
boolean sideways)
|
void |
onAction(java.lang.String name,
boolean value,
float tpf)
Called when an input to which this listener is registered to is invoked. |
void |
onAnalog(java.lang.String name,
float value,
float tpf)
Called to notify the implementation that an analog event has occurred. |
void |
registerWithInput(InputManager inputManager)
Registers the FlyByCamera to receive input events from the provided Dispatcher. |
protected void |
riseCamera(float value)
|
protected void |
rotateCamera(float value,
Vector3f axis)
|
void |
setDragToRotate(boolean dragToRotate)
Set if drag to rotate mode is enabled. |
void |
setEnabled(boolean enable)
|
void |
setMotionAllowedListener(MotionAllowedListener listener)
|
void |
setMoveSpeed(float moveSpeed)
Sets the move speed. |
void |
setRotationSpeed(float rotationSpeed)
Sets the rotation speed. |
void |
setUpVector(Vector3f upVec)
Sets the up vector that should be used for the camera. |
void |
unregisterInput()
Registers the FlyByCamera to receive input events from the provided Dispatcher. |
protected void |
zoomCamera(float value)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Camera cam
protected Vector3f initialUpVec
protected float rotationSpeed
protected float moveSpeed
protected MotionAllowedListener motionAllowed
protected boolean enabled
protected boolean dragToRotate
protected boolean canRotate
protected InputManager inputManager
Constructor Detail |
---|
public FlyByCamera(Camera cam)
cam
- Method Detail |
---|
public void setUpVector(Vector3f upVec)
upVec
- public void setMotionAllowedListener(MotionAllowedListener listener)
public void setMoveSpeed(float moveSpeed)
moveSpeed
- public float getMoveSpeed()
public void setRotationSpeed(float rotationSpeed)
rotationSpeed
- public float getRotationSpeed()
public void setEnabled(boolean enable)
enable
- If false, the camera will ignore input.public boolean isEnabled()
setEnabled(boolean)
public boolean isDragToRotate()
setDragToRotate(boolean)
public void setDragToRotate(boolean dragToRotate)
dragToRotate
- True if drag to rotate mode is enabled.public void registerWithInput(InputManager inputManager)
inputManager
- public void unregisterInput()
inputManager
- protected void rotateCamera(float value, Vector3f axis)
protected void zoomCamera(float value)
protected void riseCamera(float value)
protected void moveCamera(float value, boolean sideways)
public void onAnalog(java.lang.String name, float value, float tpf)
AnalogListener
onAnalog
in interface AnalogListener
name
- The name of the mapping that was invokedvalue
- Value of the axis, from 0 to 1.tpf
- The time per frame value.public void onAction(java.lang.String name, boolean value, float tpf)
ActionListener
onAction
in interface ActionListener
name
- The name of the mapping that was invokedvalue
- True if the action is "pressed", false otherwisetpf
- The time per frame value.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |