40 #ifndef _attachable_cpp
41 #define _attachable_cpp
62 {
return (AB ? AB->Updating :
false); }
103 if(Target->Parent ==
this)
return;
108 Target->Parent =
this;
124 Target->Parent = NULL;
158 (*it)->_RecalculateGlobalTransform(
true);
168 LocalTransformDirty(false),
169 GlobalTransformDirty(false)
198 GlobalTransformDirty =
true;
200 if(Parent && GlobalTransformDirty)
205 GlobalTransformDirty =
false;
210 if(Parent && LocalTransformDirty)
215 LocalTransformDirty =
false;
bool Boole
Generally acts a single bit, true or false.
AttachableBase()
Class constructor.
Boole GetUpdating(AttachableBase *AB) const
Gets the update status of another attachable.
virtual void SetOrientation(const Quaternion &Orientation)=0
Sets the orientation of this object.
Contains the Mezzanine::Attachable Class and Mezzanine::Attachable::AttachableElement enumeration dec...
#define MEZZ_EXCEPTION(num, desc)
An easy way to throw exceptions with rich information.
Base class for objects that can have attachables attached to them.
This class is the base class for objects that can be attached to AttachableParent.
virtual Whole GetNumAttached() const
Gets the number of elements attached to this object.
This class is the base class for other attachable classes and is responsible for transform updates to...
Quaternion GetInverse() const
Inverses this Quaternion.
AttachableContainer::const_iterator ConstAttachableIterator
Const Iterator type for AttachableChild instances stored by this class.
virtual ~AttachableChild()
Class destructor.
This implements the exception hiearchy for Mezzanine.
virtual void SetLocation(const Vector3 &Location)=0
Sets the Location of this object.
AttachableIterator EndChild()
Get an AttachableIterator to one past the last object.
virtual void DetachObject(AttachableChild *Target)
Detaches an attachable element from this object.
AttachableParent()
Class constructor.
virtual void DetachAllChildren()
Detaches all attachables currently attached.
AttachableContainer Attached
A container storing all of the other attachable objects connected to this attachable.
AttachableIterator BeginChild()
Get an AttachableIterator to the first object.
virtual AttachableChild * GetAttached(const Whole &Index) const
Get a specific attached Item.
virtual ~AttachableParent()
Class destructor.
virtual Vector3 GetScaling() const =0
Gets the scale of this object.
virtual ~AttachableBase()
Class destructor.
AttachableContainer::iterator AttachableIterator
Iterator type for AttachableChild instances stored by this class.
virtual Vector3 GetLocation() const =0
Gets the Location of this object.
virtual void AttachObject(AttachableChild *Target)
Attaches an attachable element to this object.
void _RecalculateLocalTransform()
Recalculates this objects local transform based on it's current global position.
Thrown when the available information should have worked but failed for unknown reasons.
Vector3 GetLocalLocation() const
Gets the Location of this object in local space.
This is used to represent a point in space, or a vector through space.
void _RecalculateGlobalTransform(Boole FromParent=false)
Recalculates objects global transform from parent.
The bulk of the engine components go in this namspace.
Vector3 ConvertGlobalToLocal(const Vector3 &Location) const
Converts a point in global space to the same point in local space.
unsigned long Whole
Whole is an unsigned integer, it will be at least 32bits in size.
Vector3 ConvertLocalToGlobal(const Vector3 &Location) const
Converts a point in local space to the same point in global space.
AttachableChild()
Class constructor.
AttachableParent * GetParent() const
Gets the parent of this child.
This is used to store information about rotation in 3d space.
void _RecalculateAllChildTransforms()
Recalculates the transforms of all children of this attachable.
Quaternion GetLocalOrientation() const
Gets the orientation of this object in local space.
virtual Quaternion GetOrientation() const =0
Gets the orientation of this object.