This is the base class from which all the actors inherit. More...
#include <actorbase.h>
Public Member Functions | |
| ActorBase () | |
| Constructor. | |
| virtual | ~ActorBase () |
| Destructor. | |
| virtual void | _Update ()=0 |
| Utility function for altering or checking the actor every frame. | |
| virtual void | AddToWorld ()=0 |
| Adds the actor to the physics world. | |
| virtual void | AdvanceAnimation (const Real &Time) |
| Advances the animation, making it animate. | |
| virtual void | EnableAnimation (bool Enable) |
| Enables the animation if one is set. | |
| virtual WorldAndSceneObjectType | GetType () const =0 |
| virtual String | GraphicsSettingsSerializableName () const =0 |
| Get the name of the the XML tag that implementations of this class will use to save the serialized graphics settings. | |
| virtual bool | IsAnimated () const |
| Tells whether this actor is animated or not. | |
| virtual String | PhysicsSettingsSerializableName () const =0 |
| Get the name of the the XML tag that implementations of this class will use to save the serialized s settings. | |
| virtual void | ProtoDeSerialize (const xml::Node &OneNode) |
| Take the data stored in an XML and overwrite this instance of this object with it. | |
| virtual void | ProtoSerialize (xml::Node &CurrentRoot) const |
| Convert this class to an xml::Node ready for serialization. | |
| virtual void | RemoveFromWorld ()=0 |
| Removes the actor from the physics world. | |
| virtual void | RemoveSetAnimation () |
| Unloads a loaded animation. | |
| virtual void | SetAnimation (ConstString &AnimationName, bool Loop) |
| Sets the animation for this object. | |
Static Public Member Functions | |
| static String | SerializableName () |
| Get the name of the the XML tag this class will leave behind as its instances are serialized. | |
Protected Member Functions | |
| virtual void | ThrowSerialError (const String &Fail) const |
| a Helper function that assembles strings and throws an exception | |
Protected Attributes | |
| Ogre::AnimationState * | Animation |
| This class encapsulates the functionality of the Ogre::AnimationState using this. | |
| internal::AttachableMotionState * | MotionState |
| This class encapsulates the functionality of the PhysMotionState using this. | |
Friends | |
| class | ActorBasePhysicsSettings |
| class | ActorGraphicsSettings |
| class | WorldNode |
This is the base class from which all the actors inherit.
The actor classes store and manage all the relevant data regarding objects inside the World. They serve as a binder between the physics and graphics for objects and have functions that allow the manipulation of objects loaded into the World. Currently there are 5 actor classes: ActorBase, ActorRigid, ActorSoft, ActorTerrain, ActorCharacter.
ActorBase is a base class that serves as a template for the other four actor classes.
ActorBase should never be created, as it lacks the functionality needed for most objects.
Definition at line 88 of file actorbase.h.
| Mezzanine::ActorBase::ActorBase | ( | ) |
Constructor.
This constructor contains the basic information needed to make an actor.
Definition at line 69 of file actorbase.cpp.
| Mezzanine::ActorBase::~ActorBase | ( | ) | [virtual] |
| void Mezzanine::ActorBase::AdvanceAnimation | ( | const Real & | Time | ) | [virtual] |
Advances the animation, making it animate.
| Time | The amount of time to advance the animation. |
You need to call this every frame while the actor is to be animated, otherwise even with the animation enabled you will see no change in the animation.
Definition at line 113 of file actorbase.cpp.
| void Mezzanine::ActorBase::EnableAnimation | ( | bool | Enable | ) | [virtual] |
Enables the animation if one is set.
This function will enable the animation if passed true, making the object animate. If passed false will disable the animation.
| Enable | True to enable the animation or false to disable the animation. |
Definition at line 95 of file actorbase.cpp.
| virtual WorldAndSceneObjectType Mezzanine::ActorBase::GetType | ( | ) | const [pure virtual] |
Gets the type of the World Object instance.
Implements Mezzanine::WorldObject.
Implemented in Mezzanine::ActorRigid, and Mezzanine::ActorSoft.
| virtual String Mezzanine::ActorBase::GraphicsSettingsSerializableName | ( | ) | const [pure virtual] |
Get the name of the the XML tag that implementations of this class will use to save the serialized graphics settings.
Implements Mezzanine::NonStaticWorldObject.
Implemented in Mezzanine::ActorRigid.
| bool Mezzanine::ActorBase::IsAnimated | ( | ) | const [virtual] |
Tells whether this actor is animated or not.
This function will return true if the actor has an animation set and it is enabled.
Definition at line 103 of file actorbase.cpp.
| virtual String Mezzanine::ActorBase::PhysicsSettingsSerializableName | ( | ) | const [pure virtual] |
Get the name of the the XML tag that implementations of this class will use to save the serialized s settings.
Implements Mezzanine::NonStaticWorldObject.
Implemented in Mezzanine::ActorRigid.
| void Mezzanine::ActorBase::ProtoDeSerialize | ( | const xml::Node & | OneNode | ) | [virtual] |
Take the data stored in an XML and overwrite this instance of this object with it.
| OneNode | and xml::Node containing the data. |
Reimplemented from Mezzanine::NonStaticWorldObject.
Reimplemented in Mezzanine::ActorRigid.
Definition at line 148 of file actorbase.cpp.
| void Mezzanine::ActorBase::ProtoSerialize | ( | xml::Node & | CurrentRoot | ) | const [virtual] |
Convert this class to an xml::Node ready for serialization.
| CurrentRoot | The point in the XML hierarchy that all this vectorw should be appended to. |
Reimplemented from Mezzanine::NonStaticWorldObject.
Reimplemented in Mezzanine::ActorRigid.
Definition at line 137 of file actorbase.cpp.
| void Mezzanine::ActorBase::RemoveSetAnimation | ( | ) | [virtual] |
Unloads a loaded animation.
This function will remove the existing set animation.
Definition at line 121 of file actorbase.cpp.
| String Mezzanine::ActorBase::SerializableName | ( | ) | [static] |
Get the name of the the XML tag this class will leave behind as its instances are serialized.
Reimplemented from Mezzanine::NonStaticWorldObject.
Reimplemented in Mezzanine::ActorRigid.
Definition at line 159 of file actorbase.cpp.
| void Mezzanine::ActorBase::SetAnimation | ( | ConstString & | AnimationName, |
| bool | Loop | ||
| ) | [virtual] |
Sets the animation for this object.
This function will get the specified animation for this object stored in the mesh file, and will loop the animation if specified.
| AnimationName | Name of the stored animation to be loaded. |
| Loop | Whether or not you want the animation to loop. For example, you would want an idle animation to loop, but not a death animation. |
Definition at line 85 of file actorbase.cpp.
| void Mezzanine::ActorBase::ThrowSerialError | ( | const String & | Fail | ) | const [protected, virtual] |
a Helper function that assembles strings and throws an exception
| Fail | The item that failed. |
Reimplemented from Mezzanine::NonStaticWorldObject.
Reimplemented in Mezzanine::ActorRigid.
Definition at line 134 of file actorbase.cpp.
1.7.3