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 >
using ClassInfoArray = Array< const ClassInfo * >
 Definition of an array of ClassInfo objects.
 
- Public Member Functions inherited from Murl::Resource::IObject
virtual Bool GetFileDependencies (Array< String > &fileNames) const =0
 Fill a given string array with names of files the resource depends on. More...
 
- Public Member Functions inherited from Murl::IFactoryObject< IObject >
 ~IFactoryObject () override
 The destructor.
 
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.
 
- Public Member Functions inherited from Murl::Resource::IAnimation
virtual void Evaluate (const Raw::FloatKey &startKey, const Raw::FloatKey &endKey, Double t, Float &output) const =0
 Evaluate the output value for two FloatKey entries and a given time value, and store it in a given Float variable. More...
 
virtual void Evaluate (const Raw::FloatKey &startKey, const Raw::FloatKey &endKey, Double t, Double &output) const =0
 Evaluate the output value for two FloatKey entries and a given time value, and store it in a given Double variable. More...
 
virtual void Evaluate (const Raw::SInt32Key &startKey, const Raw::SInt32Key &endKey, Double t, UInt32 &output) const =0
 Evaluate the output value for two SInt32Key entries and a given time value, and store it in a given UInt32 variable. More...
 
virtual void Evaluate (const Raw::SInt32Key &startKey, const Raw::SInt32Key &endKey, Double t, SInt32 &output) const =0
 Evaluate the output value for two SInt32Key entries and a given time value, and store it in a given SInt32 variable. More...
 
virtual void Evaluate (const Raw::BoolKey &startKey, const Raw::BoolKey &endKey, Double t, Bool &output) const =0
 Evaluate the output value for two BoolKey entries and a given time value, and store it in a given Bool variable. More...
 
virtual void Evaluate (const Raw::ColorKey &startKey, const Raw::ColorKey &endKey, Double t, Color &output) const =0
 Evaluate the RGBA output values for two ColorKey entries and a given time value, and store them in a given Color variable. More...
 
virtual void Evaluate (const Raw::PositionKey &startKey, const Raw::PositionKey &endKey, Double t, Vector &output) const =0
 Evaluate the XYZ output values for two PositionKey entries and a given time value, and store them in the X, Y and Z fields of a given Vector variable. More...
 
virtual void Evaluate (const Raw::PositionKey &startKey, const Raw::PositionKey &endKey, Double t, Matrix &output) const =0
 Evaluate the XYZ output values for two PositionKey entries and a given time value, and store them in the XW, YW and ZW fields of a given Matrix variable. More...
 
virtual void Evaluate (const Raw::ScalingKey &startKey, const Raw::ScalingKey &endKey, Double t, Vector &output) const =0
 Evaluate the XYZ output values for two ScalingKey entries and a given time value, and store them in the X, Y and Z fields of a given Vector variable. More...
 
virtual void Evaluate (const Raw::ScalingKey &startKey, const Raw::ScalingKey &endKey, Double t, Matrix &output) const =0
 Evaluate the XYZ output values for two ScalingKey entries and a given time value, and store them in the XX, YY and ZZ fields of a given Matrix variable. More...
 
virtual void Evaluate (const Raw::EulerAngleKey &startKey, const Raw::EulerAngleKey &endKey, Double t, Vector &output) const =0
 Evaluate the XYZ output rotation values for two EulerAngleKey entries and a given time value, and store them in the X, Y and Z fields of a given Vector variable. More...
 
virtual void Evaluate (const Raw::EulerAngleKey &startKey, const Raw::EulerAngleKey &endKey, Double t, Matrix &output) const =0
 Evaluate the XYZ output values for two EulerAngleKey entries and a given time value, and store their combined rotation in the upper 3x3 fields of a given Matrix variable. More...
 
virtual void Evaluate (const Raw::EulerAngleKey &startKey, const Raw::EulerAngleKey &endKey, Double t, Quaternion &output) const =0
 Evaluate the XYZ output values for two EulerAngleKey entries and a given time value, and store their combined rotation in a given Quaternion variable. More...
 
virtual void Evaluate (const Raw::AxisAngleKey &startKey, const Raw::AxisAngleKey &endKey, Double t, Vector &output) const =0
 Evaluate the XYZ axis and rotation angle output values for two AxisAngleKey entries and a given time value, and store them in the X, Y, Z and W fields of a given Vector variable. More...
 
virtual void Evaluate (const Raw::AxisAngleKey &startKey, const Raw::AxisAngleKey &endKey, Double t, Matrix &output) const =0
 Evaluate the XYZ axis and rotation angle output values for two AxisAngleKey entries and a given time value, and store the resulting rotation in the upper 3x3 fields of a given Matrix variable. More...
 
virtual void Evaluate (const Raw::AxisAngleKey &startKey, const Raw::AxisAngleKey &endKey, Double t, Quaternion &output) const =0
 Evaluate the XYZ axis and rotation angle output values for two AxisAngleKey entries and a given time value, and store the resulting rotation in a given Quaternion variable. More...
 
virtual void Evaluate (const Raw::QuaternionKey &startKey, const Raw::QuaternionKey &endKey, Double t, Vector &output) const =0
 Evaluate the RIJK output values for two QuaternionKey entries and a given time value, and store the resulting rotation axis in the X, Y and Z fields and the rotation angle in the W field of a given Vector variable. More...
 
virtual void Evaluate (const Raw::QuaternionKey &startKey, const Raw::QuaternionKey &endKey, Double t, Matrix &output) const =0
 Evaluate the RIJK output values for two QuaternionKey entries and a given time value, and store the resulting rotation in the upper 3x3 fields of a given Matrix variable. More...
 
virtual void Evaluate (const Raw::QuaternionKey &startKey, const Raw::QuaternionKey &endKey, Double t, Quaternion &output) const =0
 Evaluate the RIJK output values for two QuaternionKey entries and a given time value, and store them in a given Quaternion variable. More...
 
- 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-2024 Spraylight GmbH.