|
||||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |
java.lang.Objectcom.jme3.input.ChaseCamera
public class ChaseCamera
A camera that follows a spatial and can turn around it by dragging the mouse
コンストラクタの概要 | |
---|---|
ChaseCamera(Camera cam)
Constructs the chase camera if you use this constructor you have to attach the cam later to a spatial doing spatial.addControl(chaseCamera); |
|
ChaseCamera(Camera cam,
InputManager inputManager)
Constructs the chase camera, and registers inputs if you use this constructor you have to attach the cam later to a spatial doing spatial.addControl(chaseCamera); |
|
ChaseCamera(Camera cam,
Spatial target)
Constructs the chase camera |
|
ChaseCamera(Camera cam,
Spatial target,
InputManager inputManager)
Constructs the chase camera, and registers inputs |
メソッドの概要 | |
---|---|
Control |
cloneForSpatial(Spatial spatial)
clone this camera for a spatial |
float |
getChasingSensitivity()
returns the chasing sensitivity |
float |
getDistanceToTarget()
return the current distance from the camera to the target |
float |
getHorizontalRotation()
returns the current horizontal rotation around the target in radians |
Vector3f |
getLookAtOffset()
returns the offset from the target's position where the camera looks at |
float |
getMaxDistance()
Returns the max zoom distance of the camera (default is 40) |
float |
getMaxVerticalRotation()
returns the maximal vertical rotation angle of the camera around the target |
float |
getMinDistance()
Returns the min zoom distance of the camera (default is 1) |
float |
getMinVerticalRotation()
returns the minimal vertical rotation angle of the camera around the target |
float |
getRotationSensitivity()
Returns the rotation sensitivity |
float |
getTrailingRotationInertia()
returns the trailing rotation inertia |
float |
getTrailingSensitivity()
returns the trailing sensitivity |
Vector3f |
getUpVector()
Returns the up vector of the camera used for the lookAt on the target |
float |
getVerticalRotation()
returns the current vertical rotation around the target in radians. |
float |
getZoomSensitivity()
returns the zoom sensitivity |
boolean |
isDragToRotate()
|
boolean |
isEnabled()
Return the enabled/disabled state of the camera |
boolean |
isSmoothMotion()
returns true is smmoth motion is enabled for this chase camera |
boolean |
isTrailingEnabled()
returns true if the trailing is enabled |
void |
onAction(java.lang.String name,
boolean keyPressed,
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 |
read(JmeImporter im)
Read the camera |
void |
registerWithInput(InputManager inputManager)
Registers inputs with the input manager |
void |
render(RenderManager rm,
ViewPort vp)
renders the camera control, should only be used internally |
void |
setChasingSensitivity(float chasingSensitivity)
Sets the chasing sensitivity, the lower the value the slower the camera will follow the target when it moves |
void |
setDefaultDistance(float defaultDistance)
Sets the default distance at start of applicaiton |
void |
setDefaultHorizontalRotation(float angle)
sets the default horizontal rotation of the camera at start of the application |
void |
setDefaultVerticalRotation(float angle)
sets the default vertical rotation of the camera at start of the application |
void |
setDragToRotate(boolean dragToRotate)
|
void |
setEnabled(boolean enabled)
Enable or disable the camera |
void |
setInvertHorizontalAxis(boolean invertXaxis)
invert the Horizontal axis movement of the mouse |
void |
setInvertVerticalAxis(boolean invertYaxis)
invert the vertical axis movement of the mouse |
void |
setLookAtOffset(Vector3f lookAtOffset)
Sets the offset from the target's position where the camera looks at |
void |
setMaxDistance(float maxDistance)
Sets the max zoom distance of the camera (default is 40) |
void |
setMaxVerticalRotation(float maxVerticalRotation)
sets the maximal vertical rotation angle of the camera around the target default is Pi/2; |
void |
setMinDistance(float minDistance)
Sets the min zoom distance of the camera (default is 1) |
void |
setMinVerticalRotation(float minHeight)
sets the minimal vertical rotation angle of the camera around the target default is 0; |
void |
setRotationSensitivity(float rotationSensitivity)
Sets the rotation sensitivity, the lower the value the slower the camera will rotates around the target when draging with the mouse default is 5 |
void |
setSmoothMotion(boolean smoothMotion)
Enables smooth motion for this chase camera |
void |
setSpatial(Spatial spatial)
Sets the spacial for the camera control, should only be used internally |
void |
setToggleRotationTrigger(Trigger... triggers)
Sets custom triggers for toggleing the rotation of the cam deafult are new MouseButtonTrigger(MouseInput.BUTTON_LEFT) left mouse button new MouseButtonTrigger(MouseInput.BUTTON_RIGHT) right mouse button |
void |
setTrailingEnabled(boolean trailingEnabled)
Enable the camera trailing : The camera smoothly go in the targets trail when it moves. |
void |
setTrailingRotationInertia(float trailingRotationInertia)
Sets the trailing rotation inertia : default is 0.1. |
void |
setTrailingSensitivity(float trailingSensitivity)
Sets the trailing sensitivity, the lower the value, the slower the camera will go in the target trail when it moves. |
void |
setUpVector(Vector3f up)
Sets the up vector of the camera used for the lookAt on the target |
void |
setZoomInTrigger(Trigger... triggers)
Sets custom triggers for zomming in the cam default is new MouseAxisTrigger(MouseInput.AXIS_WHEEL, true) mouse wheel up |
void |
setZoomOutTrigger(Trigger... triggers)
Sets custom triggers for zomming out the cam default is new MouseAxisTrigger(MouseInput.AXIS_WHEEL, false) mouse wheel down |
void |
setZoomSensitivity(float zoomSensitivity)
Sets the zoom sensitivity, the lower the value, the slower the camera will zoom in and out. |
void |
update(float tpf)
update the camera control, should only be used internally |
void |
write(JmeExporter ex)
Write the camera |
クラス java.lang.Object から継承されたメソッド |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
コンストラクタの詳細 |
---|
public ChaseCamera(Camera cam, Spatial target)
cam
- the application cameratarget
- the spatial to followpublic ChaseCamera(Camera cam)
cam
- the application camerapublic ChaseCamera(Camera cam, InputManager inputManager)
cam
- the application camerainputManager
- the inputManager of the application to register inputspublic ChaseCamera(Camera cam, Spatial target, InputManager inputManager)
cam
- the application cameratarget
- the spatial to followinputManager
- the inputManager of the application to register inputsメソッドの詳細 |
---|
public void onAction(java.lang.String name, boolean keyPressed, float tpf)
ActionListener
の記述:
ActionListener
内の onAction
name
- The name of the mapping that was invokedkeyPressed
- True if the action is "pressed", false otherwisetpf
- The time per frame value.public void onAnalog(java.lang.String name, float value, float tpf)
AnalogListener
の記述:
AnalogListener
内の onAnalog
name
- The name of the mapping that was invokedvalue
- Value of the axis, from 0 to 1.tpf
- The time per frame value.public final void registerWithInput(InputManager inputManager)
inputManager
- public void setToggleRotationTrigger(Trigger... triggers)
triggers
- public void setZoomInTrigger(Trigger... triggers)
triggers
- public void setZoomOutTrigger(Trigger... triggers)
triggers
- public boolean isEnabled()
Control
内の isEnabled
Control.setEnabled(boolean)
public void setEnabled(boolean enabled)
Control
内の setEnabled
enabled
- true to enablepublic float getMaxDistance()
public void setMaxDistance(float maxDistance)
maxDistance
- public float getMinDistance()
public void setMinDistance(float minDistance)
public Control cloneForSpatial(Spatial spatial)
Control
内の cloneForSpatial
spatial
-
public void setSpatial(Spatial spatial)
Control
内の setSpatial
spatial
- public void update(float tpf)
Control
内の update
tpf
- public void render(RenderManager rm, ViewPort vp)
Control
内の render
rm
- vp
- public void write(JmeExporter ex) throws java.io.IOException
Savable
内の write
ex
- the exporter
java.io.IOException
public void read(JmeImporter im) throws java.io.IOException
Savable
内の read
im
-
java.io.IOException
public float getMaxVerticalRotation()
public void setMaxVerticalRotation(float maxVerticalRotation)
maxVerticalRotation
- public float getMinVerticalRotation()
public void setMinVerticalRotation(float minHeight)
minHeight
- public boolean isSmoothMotion()
public void setSmoothMotion(boolean smoothMotion)
smoothMotion
- public float getChasingSensitivity()
public void setChasingSensitivity(float chasingSensitivity)
chasingSensitivity
- public float getRotationSensitivity()
public void setRotationSensitivity(float rotationSensitivity)
rotationSensitivity
- public boolean isTrailingEnabled()
public void setTrailingEnabled(boolean trailingEnabled)
trailingEnabled
- public float getTrailingRotationInertia()
public void setTrailingRotationInertia(float trailingRotationInertia)
trailingRotationInertia
- public float getTrailingSensitivity()
public void setTrailingSensitivity(float trailingSensitivity)
trailingSensitivity
- public float getZoomSensitivity()
public void setZoomSensitivity(float zoomSensitivity)
zoomSensitivity
- public void setDefaultDistance(float defaultDistance)
defaultDistance
- public void setDefaultHorizontalRotation(float angle)
angle
- public void setDefaultVerticalRotation(float angle)
angle
- public boolean isDragToRotate()
FlyByCamera.setDragToRotate(boolean)
public void setDragToRotate(boolean dragToRotate)
dragToRotate
- When true, the user must hold the mouse button
and drag over the screen to rotate the camera, and the cursor is
visible until dragged. Otherwise, the cursor is invisible at all times
and holding the mouse button is not needed to rotate the camera.
This feature is disabled by default.public float getDistanceToTarget()
public float getHorizontalRotation()
public float getVerticalRotation()
public Vector3f getLookAtOffset()
public void setLookAtOffset(Vector3f lookAtOffset)
lookAtOffset
- public void setUpVector(Vector3f up)
up
- public Vector3f getUpVector()
public void setInvertVerticalAxis(boolean invertYaxis)
invertYaxis
- public void setInvertHorizontalAxis(boolean invertXaxis)
invertYaxis
-
|
||||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |