Wikitude SDK API Reference

API Docs for: 8.2.0
Show:

ModelAnimation Class

Extends Animation
Module: AR

ModelAnimations allow the control of animations defined in a Model. You can find more about working with 3D animations in the Wikitude SDK documentation.

Example:
//We want to start an animation inside a model
var model = new AR.Model("http://myServer.com/myModel.wt3");
var modelAnim = new AR.ModelAnimation(model, "hit"); //start hit-animation defined inside model

Constructor

ModelAnimation

(
  • model
  • animationId
  • options
  • duration
)

Parameters:

  • model Model

    The model that holds the animation.

  • animationId String

    The ID the animation is referenced with inside the model.

  • options Object optional

    Setup-Parameters to customize additional object properties.

    Accepted options-properties are

  • duration Number optional

Item Index

Properties

Events

Methods

destroy

()

Inherited from ARchitectObject

Destroys the object.

isRunning

() Boolean

Inherited from Animation

Checks if the Animation is currently running.

Returns:

Boolean:

true if the Animation is currently running, false if the Animation is currently not running.

pause

()

Inherited from Animation

Pauses the Animation.
If the PropertyAnimation is currently not running, the call will have no effect.

resume

()

Inherited from Animation

Resumes the Animation.
If the PropertyAnimation is currently running, the call has no effect. Otherwise, it will either be resumed from the position where it was last paused, or will start from the beginning if it was not paused.

start

(
  • loopTimes
)

Inherited from Animation

Immediately starts the Animation.

Parameters:

  • loopTimes (defaults to 1) Number optional

    Defines how often the animation should be played. A negative value indicates an infinite looping. Must be a whole number.

stop

()

Inherited from Animation

Immediately stops the Animation. Allows manual stopping of the Animation before the animation would automatically stop. The onFinish-trigger will not be fired after a manual stopping.

Properties

destroyed

Boolean

Inherited from ARchitectObject

Indicates if the object has already been destroyed.

Events

onFinish

Inherited from Animation

The trigger will fire when the Animation finishes.

The trigger is null by default, and will thus result in no action executed when the trigger fires. A developer can add custom functionality by assigning a custom function to onFinish.

onStart

Inherited from Animation

The trigger will fire right before the Animation starts.

The trigger is null by default, and will thus result in no action executed when the trigger fires. A developer can add custom functionality by assigning a custom function to onStart.