Game Engine Architecture

(Ben Green) #1
559

bool mLoop; // should the
// anim loop?

public:
/// Gets the name of the animation.
const String& getAnimationName() const;

/// Gets the time position (local clock) for this
/// anim.
Real getTimePosition(void) const;

/// Sets the time position (local clock) for this
/// anim.
void setTimePosition(Real timePos);

/// Gets the weight (influence) of this animation
Real getWeight(void) const;

/// Sets the weight (influence) of this animation
void setWeight(Real weight);

/// Modifies the time position, adjusting for
/// animation duration. This method loops if looping
/// is enabled.
void addTime(Real offset);

/// Returns true if the animation has reached the
/// end of local time line, and is not looping.
bool hasEnded(void) const;

/// Returns true if this animation is currently
/// enabled.
bool getEnabled(void) const;

/// Sets whether or not this animation is enabled.
void setEnabled(bool enabled);

/// Sets whether or not this animation should loop.
void setLoop(bool loop) { mLoop = loop; }

/// Gets whether or not this animation loops.
bool getLoop(void) const { return mLoop; }

};

Each AnimationState keeps track of one animation clip’s local clock and
its blend weight. When calculating the fi nal pose of the skeleton for a particu-
lar Ogre::Entity, Ogre’s animation system simply loops through each active


11.10. The Animation Pipeline

Free download pdf