| Package | alternativa.engine3d.controllers |
| Class | public class FlyController |
| Inheritance | FlyController ObjectController |
Local axes settings for objects that are not Camera3D:
| Axis | Direction | Rotation |
|---|---|---|
| X | Right | Pitch |
| Y | Forward | Roll |
| Z | Up | Yaw |
Local axes settings for objects that are Camera3D:
| Axis | Direction | Rotation |
|---|---|---|
| X | Right | Pitch |
| Y | Down | Yaw |
| Z | Forward | Roll |
| Property | Defined by | ||
|---|---|---|---|
![]() | accelerated : Boolean The accelerated speed mode flag.
| ObjectController | |
| acceleration : Number = 1000 Acceleration magnitude.
| FlyController | ||
![]() | checkCollisions : Boolean Enabling and disabling collision detection mode.
| ObjectController | |
![]() | collider : EllipsoidCollider
EllipsoidCollider object.
| ObjectController | |
![]() | coords : Point3D
Coordinates of the controller.
| ObjectController | |
| currentSpeed : Number [read-only] Current speed.
| FlyController | ||
| deceleration : Number = 50 Deceleration magnitude.
| FlyController | ||
| enabled : Boolean [write-only]
| FlyController | ||
| inertialMode : Boolean Inertial mode toggle.
| FlyController | ||
![]() | keyboardEnabled : Boolean Enabling and disabling processing of keyboard events.
| ObjectController | |
![]() | mouseEnabled : Boolean Enabling and disabling processing of mouse events.
| ObjectController | |
![]() | mouseSensitivity : Number Mouse sensitivity — multiplication coefficient of
mouseSensitivityX and mouseSensitivityY. | ObjectController | |
![]() | mouseSensitivityX : Number Horizontal mouse sensitivity.
| ObjectController | |
![]() | mouseSensitivityY : Number Vertical mouse sensitivity.
| ObjectController | |
![]() | object : Object3D
Controlled object.
| ObjectController | |
![]() | onStartMoving : Function Function defined as
function():void, which is called when the controlled object starts to move. | ObjectController | |
![]() | onStopMoving : Function Function defined as
function():void, which is called when the controlled object stops moving. | ObjectController | |
![]() | pitchSpeed : Number Pitch angular speed (radians per second).
| ObjectController | |
![]() | speed : Number Speed of the controlled object in units per second.
| ObjectController | |
![]() | speedMultiplier : Number Speed multiplier on acceleration.
| ObjectController | |
| speedThreshold : Number = 1 If speed is below given threshold, it is set to zero.
| FlyController | ||
![]() | yawSpeed : Number Yaw angular speed (radians per second).
| ObjectController | |
| Method | Defined by | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
FlyController(eventsSourceObject:DisplayObject)
Creates a new instance of controller.
| FlyController | ||||||||||||||||||||||||||||||
![]() |
accelerate(value:Boolean):void
Activation of accelerated speed mode.
| ObjectController | |||||||||||||||||||||||||||||
![]() |
bindKey(keyCode:uint, action:String):void
The method binds a key to an action.
| ObjectController | |||||||||||||||||||||||||||||
|
Aiming object to the point.
| FlyController | ||||||||||||||||||||||||||||||
![]() |
moveBack(value:Boolean):void
Activation of back movement.
| ObjectController | |||||||||||||||||||||||||||||
![]() |
moveDown(value:Boolean):void
Activation of down movement.
| ObjectController | |||||||||||||||||||||||||||||
![]() |
moveForward(value:Boolean):void
Activation of forward movement.
| ObjectController | |||||||||||||||||||||||||||||
![]() |
moveLeft(value:Boolean):void
Activation of left movement.
| ObjectController | |||||||||||||||||||||||||||||
![]() |
moveRight(value:Boolean):void
Activation of right movement.
| ObjectController | |||||||||||||||||||||||||||||
![]() |
moveUp(value:Boolean):void
Activation of up movement.
| ObjectController | |||||||||||||||||||||||||||||
![]() |
pitchDown(value:Boolean):void
Activation of pitching down.
| ObjectController | |||||||||||||||||||||||||||||
![]() |
pitchUp(value:Boolean):void
Activation of pitching up.
| ObjectController | |||||||||||||||||||||||||||||
![]() |
processInput():void
The method processes all control influences.
| ObjectController | |||||||||||||||||||||||||||||
![]() |
readCoords(point:Point3D):void
The method stores controller's coordinates in the given variable.
| ObjectController | |||||||||||||||||||||||||||||
|
rollLeft(value:Boolean):void
activating roll left
| FlyController | ||||||||||||||||||||||||||||||
|
rollRight(value:Boolean):void
activating roll right
| FlyController | ||||||||||||||||||||||||||||||
|
setDefaultBindings():void
The method clears all previous keys' bindings and sets the default bindings:
| FlyController | ||||||||||||||||||||||||||||||
![]() |
setMouseLook(value:Boolean):void
The method enables and disables mouse look mode.
| ObjectController | |||||||||||||||||||||||||||||
![]() |
unbindAll():void
Clear all key bindings.
| ObjectController | |||||||||||||||||||||||||||||
![]() |
unbindKey(keyCode:uint):void
Clear key binding.
| ObjectController | |||||||||||||||||||||||||||||
![]() |
yawLeft(value:Boolean):void
Activation of yawing left.
| ObjectController | |||||||||||||||||||||||||||||
![]() |
yawRight(value:Boolean):void
Activation of yawing right.
| ObjectController | |||||||||||||||||||||||||||||
| Method | Defined by | ||
|---|---|---|---|
|
applyDisplacement(frameTime:Number, displacement:Point3D):void
The method applies specified displacement vector to ellipsoid considering collision detection if needed.
| FlyController | ||
|
clearCommandFlags():void
The method resets active commands' flags.
| FlyController | ||
|
getDisplacement(frameTime:Number, displacement:Point3D):void
The method calculates displacement vector of ellipsoid
| FlyController | ||
![]() |
registerKeyboardListeners():void
The method registers necessary keyboard listeners.
| ObjectController | |
![]() |
registerMouseListeners():void
The method registers necessary mouse listeners.
| ObjectController | |
|
rotateObject(frameTime:Number):void
The method rotates controlled object around it's local axes.
| FlyController | ||
![]() |
setObjectCoords():void
The method sets coordinates of the controlled object depending on the controller's coordinates.
| ObjectController | |
![]() |
startMouseLook():void
The method performs the necessary actions when mouse look mode is activated.
| ObjectController | |
![]() |
stopMouseLook():void
The method performs the necessary actions when mouse look mode is deactivated.
| ObjectController | |
![]() |
unregisterKeyboardListeners():void
The method removes keyboard listeners when keyboard is deactivated.
| ObjectController | |
![]() |
unregisterMouseListeners():void
The method removes mouse listeners when mouse is deactivated.
| ObjectController | |
| Constant | Defined by | ||
|---|---|---|---|
![]() | ACTION_ACCELERATE : String = "ACTION_ACCELERATE" [static] Action name for binding ACCELERATE button.
| ObjectController | |
![]() | ACTION_BACK : String = "ACTION_BACK" [static] Action name for binding BACK movement button.
| ObjectController | |
![]() | ACTION_DOWN : String = "ACTION_DOWN" [static] Action name for binding DOWN movement button.
| ObjectController | |
![]() | ACTION_FORWARD : String = "ACTION_FORWARD" [static] Action name for binding FORWARD movement button.
| ObjectController | |
![]() | ACTION_LEFT : String = "ACTION_LEFT" [static] Action name for binding LEFT movement button.
| ObjectController | |
![]() | ACTION_MOUSE_LOOK : String = "ACTION_MOUSE_LOOK" [static] Action name for binding MOUSE_LOOK button.
| ObjectController | |
![]() | ACTION_PITCH_DOWN : String = "ACTION_PITCH_DOWN" [static] Action name for binding PITCH_DOWN button.
| ObjectController | |
![]() | ACTION_PITCH_UP : String = "ACTION_PITCH_UP" [static] Action name for binding PITCH_UP button.
| ObjectController | |
![]() | ACTION_RIGHT : String = "ACTION_RIGHT" [static] Action name for binding RIGHT movement button.
| ObjectController | |
| ACTION_ROLL_LEFT : String = "ACTION_ROLL_LEFT" [static] Action name for binding ROLL_LEFT button.
| FlyController | ||
| ACTION_ROLL_RIGHT : String = "ACTION_ROLL_RIGHT" [static] Action name for binding ROLL_RIGHT button.
| FlyController | ||
![]() | ACTION_UP : String = "ACTION_UP" [static] Action name for binding UP movement button.
| ObjectController | |
![]() | ACTION_YAW_LEFT : String = "ACTION_YAW_LEFT" [static] Action name for binding YAW_LEFT button.
| ObjectController | |
![]() | ACTION_YAW_RIGHT : String = "ACTION_YAW_RIGHT" [static] Action name for binding YAW_RIGHT button.
| ObjectController | |
| acceleration | property |
public var acceleration:Number = 1000Acceleration magnitude.
| currentSpeed | property |
currentSpeed:Number [read-only]Current speed.
Implementation public function get currentSpeed():Number
| deceleration | property |
public var deceleration:Number = 50Deceleration magnitude.
| enabled | property |
enabled:Boolean [write-only]Implementation
public function set enabled(value:Boolean):void
| inertialMode | property |
public var inertialMode:BooleanInertial mode toggle. In inertial mode deceleration doesn't exist, therefore object's velocity vector remains unchanged without control influences. When inertial mode is turned off, a deceleration is applied to the controlled object.
| speedThreshold | property |
public var speedThreshold:Number = 1If speed is below given threshold, it is set to zero.
| FlyController | () | constructor |
public function FlyController(eventsSourceObject:DisplayObject)Creates a new instance of controller.
ParameterseventsSourceObject:DisplayObject — Mouse and keyboard events' source. |
ArgumentError — throws if eventsSourceObject is null |
| applyDisplacement | () | method |
protected override function applyDisplacement(frameTime:Number, displacement:Point3D):voidThe method applies specified displacement vector to ellipsoid considering collision detection if needed.
ParametersframeTime:Number — frame length given in seconds |
|
displacement:Point3D — the ellipsoid's displacement vector |
| clearCommandFlags | () | method |
protected override function clearCommandFlags():voidThe method resets active commands' flags.
| getDisplacement | () | method |
protected override function getDisplacement(frameTime:Number, displacement:Point3D):voidThe method calculates displacement vector of ellipsoid
ParametersframeTime:Number — frame length given in seconds |
|
displacement:Point3D — calculated displacement is stored in this parameter |
| lookAt | () | method |
public function lookAt(point:Point3D):voidAiming object to the point. The "forward" axis of the object becomes directed to the specified point. Angle of rotation around "forward" axis is set to zero.
Parameterspoint:Point3D — coordinates of the target point |
| rollLeft | () | method |
public function rollLeft(value:Boolean):voidactivating roll left
Parametersvalue:Boolean |
| rollRight | () | method |
public function rollRight(value:Boolean):voidactivating roll right
Parametersvalue:Boolean |
| rotateObject | () | method |
protected override function rotateObject(frameTime:Number):voidThe method rotates controlled object around it's local axes.
ParametersframeTime:Number — frame length given in seconds |
| setDefaultBindings | () | method |
public override function setDefaultBindings():voidThe method clears all previous keys' bindings and sets the default bindings:
| Key | Action |
|---|---|
| W | ACTION_FORWARD |
| S | ACTION_BACK |
| A | ACTION_LEFT |
| D | ACTION_RIGHT |
| SPACE | ACTION_UP |
| Z | ACTION_DOWN |
| UP | ACTION_PITCH_UP |
| DOWN | ACTION_PITCH_DOWN |
| LEFT | ACTION_ROLL_LEFT |
| RIGHT | ACTION_ROLL_RIGHT |
| Q | ACTION_YAW_LEFT |
| E | ACTION_YAW_RIGHT |
| M | ACTION_MOUSE_LOOK |
| ACTION_ROLL_LEFT | constant |
public static const ACTION_ROLL_LEFT:String = "ACTION_ROLL_LEFT"Action name for binding ROLL_LEFT button.
| ACTION_ROLL_RIGHT | constant |
public static const ACTION_ROLL_RIGHT:String = "ACTION_ROLL_RIGHT"Action name for binding ROLL_RIGHT button.