Wikitude ARchitect v2.0 API Documentation

Wikitude ARchitect > AR > PropertyAnimation
Filters

Class PropertyAnimation - extends Animation

Property Animations allow constant changes to a numeric value/property of an object, dependent on start-value, end-value and the duration of the animation.

Animations can be seen as functions defining the progress of the change on the value. The Animation can be parametrized via easing curves.

Example:
//We want to animate a GeoLocation to move 100 meters up in altitude
// over a period of 10 seconds to simulate an elevator
var elevatorAnimation = new AR.PropertyAnimation(
  geoLocation1, //the object geoLocation1 holds the animated property
  "altitude", //the property altitude will be animated
  500, //the start value of the animation is 500 meters
  600, //the resulting value of the animation is 600 meters
  10000, //the duration of the elevator climb is 10 seconds (10000 miliseconds)
  {type: AR.CONST.EASING_CURVE_TYPE.EASE_IN_OUT_QUAD}, //easing curve to simulate acceleration and deceleration
  {onFinish : beepSound.play} //when finished, play a beep sound that elevator doors will now open
);
Easing Curves describe in which way a PropertyAnimation will change the animated property's value from the start- to the end-value. A good description of various Easing Curves, including the ones supported by the Wikitude ARchitect, is described here.

The following Easing Curve types are defined (see AR.CONST.EASING_CURVE_TYPE):

ConstantString Representation
LINEARlinear
EASE_IN_QUADeaseInQuad
EASE_OUT_QUADeaseOutQuad
EASE_IN_OUT_QUADeaseInOutQuad
EASE_OUT_IN_QUADeaseOutInQuad
EASE_IN_CUBICeaseInCubic
EASE_OUT_CUBICeaseOutCubic
EASE_IN_OUT_CUBICeaseInOutCubic
EASE_OUT_IN_CUBICeaseOutInCubic
EASE_IN_QUATeaseInQuat
EASE_OUT_QUATeaseOutQuat
EASE_IN_OUT_QUATeaseInOutQuat
EASE_OUT_IN_QUATeaseOutInQuat
EASE_IN_QUINTeaseInQuint
EASE_OUT_QUINTeaseOutQuint
EASE_IN_OUT_QUINTeaseInOutQuint
EASE_OUT_IN_QUINTeaseOutInQuint
EASE_IN_ELASTICeaseInElastic
EASE_OUT_ELASTICeaseOutElastic
EASE_IN_OUT_ELASTICeaseInOutElastic
EASE_OUT_IN_ELASTICeaseOutInElastic
EASE_IN_BACKeaseInBack
EASE_OUT_BACKeaseOutBack
EASE_IN_OUT_BACKeaseInOutBack
EASE_OUT_IN_BACKeaseOutInBack
EASE_IN_SINEeaseInSine
EASE_OUT_SINEeaseOutSine
EASE_IN_OUT_SINEeaseInOutSine
EASE_OUT_IN_SINEeaseOutInSine
EASE_IN_EXPOeaseInExpo
EASE_OUT_EXPOeaseOutExpo
EASE_IN_OUT_EXPOeaseInOutExpo
EASE_OUT_IN_EXPOeaseOutInExpo
EASE_IN_CIRCeaseInCirc
EASE_OUT_CIRCeaseOutCirc
EASE_IN_OUT_CIRCeaseInOutCirc
EASE_OUT_IN_CIRCeaseOutInCirc
EASE_IN_BOUNCEeaseInBounce
EASE_OUT_BOUNCEeaseOutBounce
EASE_IN_OUT_BOUNCEeaseInOutBounce
EASE_OUT_IN_BOUNCEeaseOutInBounce
EASE_IN_CURVEeaseInCurve
EASE_OUT_CURVEeaseOutCurve
EASE_SIN_CURVEeaseSinCurve
EASE_COS_CURVEeaseCosineCurve

Certain Easing Curves can be parametrized with additional values, such as amplitude, period and overshoot.
Amplitude is valid for all easing curves with the type description ending on ELASTIC or BOUNCE (like EASE_IN_ELASTIC or EASE_IN_BOUNCE), and will be ignored for all others.
Overshoot is valid for all easing curves with the type description ending on BACK (like EASE_IN_BACK), and will be ignored for all others.
Period is valid for all easing curves with the type description ending on BOUNCE (like EASE_IN_BOUNCE), and will be ignored for all others.

Example:
var easingCurve = {
  type : AR.CONST.EASING_CURVE_TYPE.EASE_IN_BACK,
  overshoot : 1.70158 //results in a 10% overshoot
};
The same Easing Curve can be instanziated by writing
var easingCurve = {
  type : "easeInBack",
  overshoot : 1.70158 //results in a 10% overshoot
};

Constructor

PropertyAnimation ( target , property , start , end , duration , easingCurve , options )
Parameters:
target <ARchitectObject> The object which holds the property that will be animated. Must be an ARchitectObject.
property <string> The object's property name that will be animated.
start <int|float> The value the PropertyAnimation will start with. If null, the current value of the property will be used. Remark: In case null is set as start value, and the PropertyAnimation loops more than once, the PropertyAnimation will not reset the value after it has completed the first run, and the value won't change in the following runs. To reset the value after each run, supply the property's current value as start value.
end <int|float> The value the PropertyAnimation will end with. The value must be non-null.
duration <int> The duration of the PropertyAnimation, in milliseconds. The value must be non-negative.
easingCurve <EasingCurve> an easing curve describing the nature of the animation (see description above for details). If the easingCurve parameter is omitted, set to null or undefined or does not contain a type property, the easingCurve parameter will default to a linear easing curve.
options <object> Setup-Parameters to customize additional object properties.

Accepted options-properties are
  • onStart
  • onFinish

Properties inherited from ARchitectObject:

Methods inherited from ARchitectObject:

Methods inherited from Animation:


Copyright © 2013 Wikitude GmbH. All rights reserved.