Base class for keyboard based camera controllers. Tracks the keyboard state for camera controllers.
protected var _camera:Cameraprotected var _fixedFrameTime:Number = 0protected var _maximumFrameTime:Number = 0.5protected var _running:Boolean = falseprotected var _stage:DisplayObjectprotected var _useInternalTick:Boolean = trueprotected var aDown:Boolean = falsepublic var autoStart:Boolean = truecamera:Camera
The camera to control with this controller.
Implementation public function get camera():Camera public function set camera(value:Camera):voidprotected var dDown:Boolean = falseprotected var downDown:Boolean = falsefixedFrameTime:Number
Indicates a fixed time (in seconds) to use for every frame. Setting
this property causes the controller to bypass its frame timing
functionality and use the given time for every frame. This enables
the particle system to be frame based rather than time based.
To return to time based animation, set this value to zero (the
default).
This feature only works if useInternalTick is true (the default).
Implementation public function get fixedFrameTime():Number public function set fixedFrameTime(value:Number):voidSee also
protected var leftDown:Boolean = falsemaximumFrameTime:Number
The maximum duration for a single update frame, in seconds.
Under some circumstances related to the Flash player (e.g. on MacOSX, when the
user right-clicks on the flash movie) the flash movie will freeze for a period. When the
freeze ends, the current frame of the particle system will be calculated as the time since
the previous frame, which encompases the duration of the freeze. This could cause the
system to generate a single frame update that compensates for a long period of time and
hence moves the particles an unexpected long distance in one go. The result is usually
visually unacceptable and certainly unexpected.
This property sets a maximum duration for a frame such that any frames longer than
this duration are ignored. The default value is 0.5 seconds. Developers don't usually
need to change this from the default value.
Implementation public function get maximumFrameTime():Number public function set maximumFrameTime(value:Number):voidprotected var pgDownDown:Boolean = falseprotected var pgUpDown:Boolean = falseprotected var rightDown:Boolean = falseprotected var sDown:Boolean = falsestage:DisplayObject
The stage - used for listening to keyboard events
Implementation public function get stage():DisplayObject public function set stage(value:DisplayObject):voidprotected var upDown:Boolean = falseuseInternalTick:Boolean
Indicates whether the controller should manage its own internal update
tick. The internal update tick is tied to the frame rate and updates
the particle system every frame.
If users choose not to use the internal tick, they have to call
the controller's update method with the appropriate time parameter every
time they want the controller to update the camera.
Implementation public function get useInternalTick():Boolean public function set useInternalTick(value:Boolean):voidprotected var wDown:Boolean = falsepublic function KeyboardControllerBase()
The constructor creates an OrbitCamera controller.
public function start():void
Starts the controller.
public function stop():void
Stops the controller.
public function update(time:Number):void Parameters
protected function updateCamera(time:Number):void Parameters
Sun Feb 27 2011, 06:00 PM Z