Packageaway3d.animators
Classpublic class PathAnimator
InheritancePathAnimator Inheritance Animator Inheritance flash.events.EventDispatcher

Public Properties
 PropertyDefined by
  alignToPath : Boolean
Defines whether the 3d object aligns its rotation to the axis of the path while animating along the path.
PathAnimator
 InheritedcurrentFrame : int
Returns the current keyframe number
Animator
 InheritedcycleNumber : int
Returns the number of the current loop cycle
Animator
 Inheriteddelay : Number
Defines the delay to the start of the animation in seconds
Animator
 Inheritedfps : Number
Defines the keyframes per second of the animation
Animator
 Inheritedinterpolate : Boolean
Defines whether the animation interpolates between channel points.
Animator
 InheritedisPlaying : Boolean
Returns true when the animation is playing
Animator
 Inheritedlength : Number
Defines the total length of the animation in seconds
Animator
 Inheritedloop : Boolean
Defines whether the animation will loop.
Animator
  offset : Number3D
sets an optional offset to the position on the path, ideal for cameras or reusing the same Path object for parallel animations
PathAnimator
  path : Path
defines the path used by the animation.
PathAnimator
  position : Number3D
[read-only] returns the current interpolated position on the path with no optional offset applied
PathAnimator
 Inheritedprogress : Number
Represents the progress of the animation playhead from the start (0) to the end (1) of the animation.
Animator
  rotation : Number3D
[read-only] returns the current interpolated rotation along the path.
PathAnimator
  rotations : Array
Defines an optional array of rotations in order to follow a path that is twisted along its axis.
PathAnimator
 Inheritedtarget : Object3D
Defines the 3d object to which the animation is applied.
Animator
  targetObject : Object3D
Defines a target object that the 3d object looks at while animating along the path.
PathAnimator
 InheritedtotalFrames : Number
Returns the total length of the animation in frames
Animator
Protected Properties
 PropertyDefined by
 Inherited_currentFrame : int
Animator
 Inherited_fraction : Number
Animator
 Inheritedini : Init
Instance of the Init object used to hold and parse default property values specified by the initialiser object in the 3d object constructor.
Animator
 Inherited_invFraction : Number
Animator
 Inherited_progress : Number = 0
Animator
 Inherited_target : Object3D
Animator
 Inherited_time : Number
Animator
Public Methods
 MethodDefined by
  
PathAnimator
(path:Path = null, target:Object3D = null, init:Object = null)
Creates a new PathAnimator
PathAnimator
 Inherited
addOnCycle(listener:Function):void
Default method for adding a cycle event listener.
Animator
 Inherited
addOnEnterKeyFrame(listener:Function):void
Default method for adding an enterKeyFrame event listener
Animator
 Inherited
clone(animator:Animator = null):Animator
Duplicates the animators properties to another Animator object
Animator
  
getPathPosition(time:Number, position:Number3D = null):Number3D
Returns a position on the path determined by the elapsed time given.
PathAnimator
  
getPositionOnPath(p:Number3D, t:Number):void
Updates a position Number3D on the path at a given time.
PathAnimator
  
getTimeSegment(t:Number):Number
returns the segment index that is used at a given time;
PathAnimator
 Inherited
gotoAndPlay(frame:uint):void
Animator
 Inherited
gotoAndStop(frame:uint):void
Animator
 Inherited
play():void
Animator
 Inherited
removeOnCycle(listener:Function):void
Default method for removing a cycle event listener
Animator
 Inherited
removeOnEnterKeyFrame(listener:Function):void
Default method for removing a enterKeyFrame event listener
Animator
 Inherited
stop():void
Animator
 Inherited
update(time:Number):void
Updates the position of the playhead to the given time in seconds.
Animator
Protected Methods
 MethodDefined by
  
getDefaultFps():Number
PathAnimator
  
updateProgress(val:Number):void
PathAnimator
  
updateTarget():void
PathAnimator
Events
 EventSummaryDefined by
 Inherited Dispatched when a looping animation starts a new cycle.Animator
 Inherited Dispatched when entering a new keyframe.Animator
 Inherited Dispatched when the animation starts.Animator
 Inherited Dispatched when the animation stops.Animator
Property detail
alignToPathproperty
public var alignToPath:Boolean

Defines whether the 3d object aligns its rotation to the axis of the path while animating along the path. Defaults to false.

offsetproperty 
public var offset:Number3D

sets an optional offset to the position on the path, ideal for cameras or reusing the same Path object for parallel animations

pathproperty 
path:Path  [read-write]

defines the path used by the animation.

Implementation
    public function get path():Path
    public function set path(value:Path):void

See also

Path
positionproperty 
position:Number3D  [read-only]

returns the current interpolated position on the path with no optional offset applied

Implementation
    public function get position():Number3D
rotationproperty 
rotation:Number3D  [read-only]

returns the current interpolated rotation along the path.

Implementation
    public function get rotation():Number3D
rotationsproperty 
public var rotations:Array

Defines an optional array of rotations in order to follow a path that is twisted along its axis.

targetObjectproperty 
public var targetObject:Object3D

Defines a target object that the 3d object looks at while animating along the path. Defaults to null.

Constructor detail
PathAnimator()constructor
public function PathAnimator(path:Path = null, target:Object3D = null, init:Object = null)Parameters
path:Path (default = null) — [optional] Defines the Path object used tp define the path of the animation.
 
target:Object3D (default = null) — [optional] Defines the 3d object to which the animation is applied.
 
init:Object (default = null) — [optional] An initialisation object for specifying default instance properties.
Init Parameters
 targetObject:Object3D
 alignToPath",false:Boolean
 offset:Number3D
 rotations:Array
Method detail
getDefaultFps()method
protected override function getDefaultFps():Number

Returns
Number
getPathPosition()method 
public function getPathPosition(time:Number, position:Number3D = null):Number3D

Returns a position on the path determined by the elapsed time given.

Parameters
time:Number — time A number representing the elapsed time in seconds.
 
position:Number3D (default = null) — position [optional] A 3d number object representing the instance to be returned.

Returns
Number3D — A Number3D object representing the position.
getPositionOnPath()method 
public function getPositionOnPath(p:Number3D, t:Number):void

Updates a position Number3D on the path at a given time. Do not use this handler to animate, it's in there to add dummy's or place camera before or after the animated object. Use the update() method or progress property instead.

Parameters
p:Number3D — Number3D. The Number3D to update according to the "t" time parameter.
 
t:Number — Number. A Number from 0 to 1

See also

animateOnPath
update
getTimeSegment()method 
public function getTimeSegment(t:Number):Number

returns the segment index that is used at a given time;

Parameters
t:Number — t [Number]. A Number between 0 and 1. If no params, actual pathanimator time segment index is returned.

Returns
Number
updateProgress()method 
protected override function updateProgress(val:Number):void Parameters
val:Number
updateTarget()method 
protected override function updateTarget():void
Wiki link
Click to go to the wiki page for 'away3d.animators.PathAnimator'

Code examples

Comments