The XML animation resource class. More...

#include "murl_resource_xml_animation.h"

Inheritance diagram for Murl::Resource::XmlAnimation:

Additional Inherited Members

- Public Types inherited from Murl::IFactoryObject< IObject >
typedef Array< const ClassInfo *> ClassInfoArray
 Definition of an array of ClassInfo objects. More...
 
- Public Member Functions inherited from Murl::IFactoryObject< IObject >
virtual ~IFactoryObject ()
 The destructor. More...
 
virtual const ClassInfo * GetObjectClassInfo () const=0
 Get the object instance's class info, if present. More...
 
virtual void ResetObjectProperties ()=0
 Reset the object instance's properties to their default values.
 
- Static Public Member Functions inherited from Murl::IFactoryObject< IObject >
static const PropertyInfoGetPropertyInfo ()
 Get the class' property info struct. More...
 
static const AttributeInfoGetAttributeInfo ()
 Get the class' attribute info struct. More...
 
static void ResetProperties (IFactoryObject< IObject > *object)
 Reset an object instance's properties to their default values. More...
 

Detailed Description

The XML animation resource class.

An XML animation file is recognized by its <Animation> root element. The root element accepts the following attributes:

  • startTime: The overall animation start time in seconds, stored as a double-precision floating point value. Together with the endTime attribute below, this defines the actual time range of the animation, but only if there are no explicit clips given. In such a case, both startTime and endTime of the root element are ignored, and each present clip defines its own time range. See below.
  • endTime: The overall end time in seconds.

As mentioned above, it is possible to either define a number of different clips for a single animation each containing any number of individual key frames, or to create a "clip-less" animation which in fact contains a single unnamed clip.

The root element may contain any number of clips, recognized by the <Clip> element. A clip element requires the following attributes to be set:

  • index: The zero-based unique index of the clip within the animation resource.
  • name: The name of the clip, which must be unique within this animation resource.
  • startTime: The start time of the clip in seconds (double precision float).
  • endTime: The end time of the clip in seconds (double precision float).

There exist a number of different key frame types, with may be either defined as children of a clip, or as direct children of the root element if no explicit clips are given. The following attributes are common to all key frame types:

  • time: The actual key frame time, in seconds.
  • interpolation: The interpolation mode between this key and the subsequent one, from the IEnums::Interpolation enumeration.

Following is a list of specific key frame types and their possible values:

  • <VisibleKey>, <ActiveKey>: Boolean keys controlling the "visible" and "active" states of a node, via Graph::ITraversable::SetVisible() and Graph::ITraversable::SetActive(), respectively.
    Accepted attribute:
    • value: Bool true/false
  • <IndexKey>: A signed 32bit integer key affecting the "index" value of via a node's Graph::IIndexed::SetIndex() method.
    Accepted attribute:
    • value: SInt32 index.
  • <DepthOrderKey>: A signed 32bit integer key affecting the depth order of a drawable via the Graph::ITransformable::SetDepthOrder() method.
    Accepted attribute:
    • value: SInt32 depth order (higher values in front of lower ones).
  • <VolumeKey>: A 32bit floating point key affecting the audio volume of a sound object via the Graph::IAudible::SetVolume() method.
    Accepted attribute:
    • value: Float audio volume.
  • <AmbientColorKey>, <DiffuseColorKey>, <SpecularColorKey>, <EmissiveColorKey>: Color keys controlling the respective lighting component color properties of a node, via Graph::IColored::SetColor().
    Accepted attribute:
  • <PositionKey>: A vector key affecting the position of a drawable in 3D space, via the Graph::ITransformable::SetPosition() method.
    Accepted attributes:
    • posX: Float position in X direction
    • posY: Float position in Y direction
    • posZ: Float position in Z direction
  • <ScalingKey>: A vector key affecting the scale factor of a drawable in 3D space, via the Graph::IScalable::SetScaleFactor() method.
    Accepted attributes:
    • scale: Float scale factor for all three axes.
    • scaleX: Float scale factor in X direction
    • scaleY: Float scale factor in Y direction
    • scaleZ: Float scale factor in Z direction
  • <RotationKey>: A key affecting the rotation of a drawable in 3D space, via the Graph::ITransformable::SetRotation() method. This key accepts the rotation either in an euler angle or axis/angle or a quaternion representation (mutually exclusive).
    Accepted attributes for euler angles:
    • angleX: Float X rotation angle, either with "deg" or "rad" suffix for degrees or radians, respectively.
    • angleY: Float Y rotation angle, either with "deg" or "rad" suffix for degrees or radians, respectively.
    • angleZ: Float Z rotation angle, either with "deg" or "rad" suffix for degrees or radians, respectively.
    • rotationOrder: The axis rotation order from IEnum::RotationOrder enumeration.
    Accepted attributes for axis/angle:
    • axisX: Float value for the normalized rotation axis' X component.
    • axisY: Float value for the normalized rotation axis' Y component.
    • axisZ: Float value for the normalized rotation axis' Z component.
    • angle: Float rotation angle, either with "deg" or "rad" suffix for degrees or radians, respectively.
    Accepted attributes for quaternion:
    • quatR: Float value for the R (real) component of the rotation quaternion.
    • quatI: Float value for the I (imaginary i) component of the rotation quaternion.
    • quatJ: Float value for the J (imaginary j) component of the rotation quaternion.
    • quatK: Float value for the K (imaginary k) component of the rotation quaternion.
  • <BlendFactorKey>: A 32bit floating point key affecting the blend factor of a node, via the Graph::IBlendable::SetBlendFactor() method.
    Accepted attributes:
    • keySet: Zero-based UInt32 index of the blend factor key set.
    • value: Float blend factor.

Example of an XML animation file:

<?xml version="1.0" ?>
<Animation>
<Clip index="0" name="ClipTPose" startTime="0.000000" endTime="0.000000">
<PositionKey time="0.000000" posX="0.000000" posY="0.000000" posZ="-12.547734"/>
<RotationKey time="0.000000" quatR="0.999967" quatI="0.000000" quatJ="-0.008164" quatK="0.000000"/>
</Clip>
<Clip index="1" name="ClipIdle" startTime="0.000000" endTime="6.360000">
<PositionKey time="0.000000" posX="0.000000" posY="0.000000" posZ="-12.547734"/>
<PositionKey time="6.360000" posX="0.000000" posY="0.000000" posZ="-12.547734"/>
<RotationKey time="0.000000" quatR="0.998398" quatI="0.009871" quatJ="-0.055706" quatK="-0.000511"/>
<RotationKey time="6.360000" quatR="0.998398" quatI="0.009871" quatJ="-0.055706" quatK="-0.000511"/>
</Clip>
</Animation>

Use the <Resource> tag in a .murlres package's resource.xml file to specify an XML animation resource. See Resource::Object.


The documentation for this class was generated from the following file:
  • murl_resource_xml_animation.h


Copyright © 2011-2018 Spraylight GmbH.