40 #ifndef _areaeffect_cpp
41 #define _areaeffect_cpp
43 #include "areaeffect.h"
45 #include "Physics/physicsmanager.h"
46 #include "Physics/collisionshape.h"
47 #include "Physics/collisionshapemanager.h"
48 #include "Physics/ghostproxy.h"
50 #include "Graphics/mesh.h"
51 #include "Graphics/meshmanager.h"
54 #include "Graphics/scenemanager.h"
90 if( PhysMan != NULL ) {
97 UInt16 ColGroup = Physics::CF_SensorFilter;
98 UInt16 ColMask = Physics::CF_AllFilter & ~(Physics::CF_SensorFilter | Physics::CF_StaticFilter);
108 if( this->
Ghost != NULL && PhysMan != NULL ) {
118 {
return Mezzanine::WO_AreaEffectUnknown; }
121 {
return this->
Ghost; }
134 Proxies.push_back( this->
Ghost );
139 if( Types & Mezzanine::PT_Physics_GhostProxy ) {
140 Proxies.push_back( this->
Ghost );
312 if( !ProxiesNode.
Empty() ) {
319 if( !GhostProxNode.
Empty() ) {
338 {
return "AreaEffect"; }
352 for(
UInt32 ProxIndex = 0 ; ProxIndex < NumProxies ; ++ProxIndex )
355 if( CurrProxy != NULL ) {
357 if( CurrObject != NULL ) {
362 ObjectIterator PrevCheck = std::find( PrevOverlapping.begin(), PrevOverlapping.end(), CurrObject );
363 if( PrevCheck == PrevOverlapping.end() ) {
370 PrevOverlapping.erase( PrevCheck );
378 if( !PrevOverlapping.empty() ) {
385 if( ToBeDestroyed == NULL )
388 if( this->
Ghost == ToBeDestroyed ) {
This is the base class for all collision shapes.
virtual void Yaw(const Real Angle)
Rotate the object around the Y axis.
virtual void AddToWorld()
Performs all the necessary task to ensure this object is connected to it's respective world and ready...
Attribute AppendAttribute(const Char8 *Name)
Creates an Attribute and puts it at the end of this Nodes attributes.
WorldManager * GetManager(const Whole ManagerToGet)
This is will find the manager of a given type.
ObjectContainer & GetOverlappingObjects()
Gets the list of objects within this field.
virtual void Pitch(const Real Angle)
Rotate the object around the X axis.
virtual void SetLocation(const Vector3 &Loc)
Sets the location of this object in parent space.
virtual void AddToWorld()
Adds the object to the World.
virtual void Rotate(const Vector3 &Axis, const Real Angle)
Rotates the object from it's existing rotation.
ObjectContainer & GetRemovedObjects()
Gets the list of objects that have been removed from the list since the last simulation step...
ObjectContainer AddedObjects
Container of actors that have been added since last frame.
bool Boole
Generally acts a single bit, true or false.
std::vector< WorldObject * > ObjectContainer
Basic container type for Object storage by this class.
virtual void Rotate(const Vector3 &Axis, const Real Angle)
Rotates the object from it's existing rotation.
virtual void Translate(const Vector3 &Trans)
Moves this object from it's current location.
virtual UInt32 GetNumShapeOverlappingProxies() const
Gets the number of proxies overlapping with the actual collision shape of this ghost.
virtual void Yaw(const Real Angle)
Rotate the object around the Y axis.
UInt32 GetNumRemovedObjects() const
Gets the number of objects removed from this AE since the last update.
virtual void ProtoDeSerializeProperties(const XML::Node &SelfRoot)
Take the data stored in an XML Node and overwrite the properties of this object with it...
This is the proxy object for ghost objects with no contact response.
ObjectContainer::iterator ObjectIterator
Iterator type for Object instances stored by this class.
Thrown when the requested identity could not be found.
Node GetFirstChild() const
Get the first child Node of this Node.
#define MEZZ_EXCEPTION(num, desc)
An easy way to throw exceptions with rich information.
Thrown when a version is accessed/parsed/required and it cannot work correctly or is missing...
virtual Vector3 GetLocation() const
Gets this objects current location.
World * ParentWorld
This is the world this object belongs to and will be inserted in/removed from.
virtual void ProtoDeSerializeProxies(const XML::Node &SelfRoot)
Take the data stored in an XML Node and overwrite the proxies of this object with it...
virtual CollidableProxy * GetShapeOverlappingProxy(const UInt32 Index)
Gets a proxy overlapping with the collision shape of this ghost.
virtual void SetScale(const Vector3 &Sc)
Sets the scaling to be applied to this object.
ObjectContainer & GetAddedObjects()
Gets the list of objects that have been added to the list since the last simulation step...
virtual Boole IsKinematic() const
Is the object kinematic.
virtual void ProtoSerializeProxies(XML::Node &SelfRoot) const
Convert the proxies of this class to an XML::Node ready for serialization.
ObjectContainer OverlappingObjects
Container for actors within the field area.
GhostProxy * CreateGhostProxy()
Creates a new GhostProxy.
bool Empty() const
Is this storing anything at all?
virtual void SetLocation(const Vector3 &Loc)
Sets the location of this object in parent space.
virtual Boole IsInWorld() const
Gets whether or not this object is currently in the world.
This implements the exception hiearchy for Mezzanine.
virtual void Pitch(const Real Angle)
Rotate the object around the X axis.
virtual void Roll(const Real Angle)
Rotate the object around the Z axis.
virtual void ProtoSerialize(XML::Node &ParentNode) const
Convert this class to an XML::Node ready for serialization.
virtual void Scale(const Vector3 &Scale)
Scales the object from it's current size.
float Real
A Datatype used to represent a real floating point number.
The interface for serialization.
bool SetValue(const Char8 *rhs)
Set the value of this.
This is the base class from which classes that are insertable into the physical world.
virtual Boole IsStatic() const
Checks of the object is static.
uint16_t UInt16
An 16-bit unsigned integer.
virtual void ProtoSerializeProperties(XML::Node &SelfRoot) const
Convert the properties of this class to an XML::Node ready for serialization.
virtual WorldObjectType GetType() const
Gets the type of the object instance.
virtual Vector3 GetScale() const
Gets the scaling currently being applied to this object.
virtual void SetOrientation(const Quaternion &Ori)
Sets the orientation of this object in parent space.
virtual Vector3 GetScale() const
Gets the scaling currently being applied to this object.
virtual void ProtoSerializeProperties(XML::Node &SelfRoot) const
Convert the properties of this class to an XML::Node ready for serialization.
AreaEffect(World *TheWorld)
Blank constructor.
virtual void CreateAreaEffect(Physics::CollisionShape *Shape)
Common constructor method for AreaEffect base class.
virtual Boole IsStatic() const
Is the object static.
A light-weight handle for manipulating nodes in DOM tree.
virtual Boole IsKinematic() const
Checks of the object is kinematic.
int AsInt(int def=0) const
Attempts to convert the value of the attribute to an int and returns the results. ...
This is the base class for proxy objects belonging to the various 3D subsystems.
uint32_t UInt32
An 32-bit unsigned integer.
virtual void ProtoDeSerializeProperties(const XML::Node &SelfRoot)
Take the data stored in an XML Node and overwrite the properties of this object with it...
This file contains the declaration for the World proxy wrapping basic entity(mesh) functionality...
virtual void SetScale(const Vector3 &Sc)
Sets the scaling to be applied to this object.
virtual void _NotifyProxyDestroyed(WorldProxy *ToBeDestroyed)
Notifies that a proxy belonging to this WorldObject is being forcibly destroyed, and it needs to upda...
void _Bind(WorldObject *NewParent)
Binds this proxy to a WorldObject.
virtual void DestroyAreaEffect()
Common destructor method for AreaEffect base class.
static String GetSerializableName()
Get the name of the the XML tag the proxy class will leave behind as its instances are serialized...
Physics::GhostProxy * Ghost
A pointer to the ghost powering this AE field.
virtual Quaternion GetOrientation() const
Gets this objects current orientation.
virtual String GetDerivedSerializableName() const
Gets the most derived serializable name of this WorldObject.
This is a proxy from which physics objects that can collide with each other are handled.
virtual void RemoveFromWorld()
Unhooks this proxy from it's respective world.
This is simply a place for storing all the Physics Related functions.
virtual void Roll(const Real Angle)
Rotate the object around the Z axis.
This is used to represent a point in space, or a vector through space.
virtual void Translate(const Vector3 &Trans)
Moves this object from it's current location.
WorldObjectType
Used by various classes to help identify what class an object is.
virtual void RemoveFromWorld()
Removes the object from the World.
UInt32 GetNumOverlappingObjects() const
Gets the number of objects currently overlapping with this AE.
virtual void Scale(const Vector3 &Scale)
Scales the object from it's current size.
virtual Quaternion GetOrientation() const
Gets this objects current orientation.
virtual void GetProxies(ProxyContainer &Proxies)
Populates a container with all of the WorldProxies being used by this WorldObject.
The bulk of the engine components go in this namspace.
This file contains the declaration for the World proxy wrapping particle functionality.
void DestroyProxy(CollidableProxy *ToBeDestroyed)
Deletes a CollidableProxy.
This class represents a world for objects to interact within.
virtual Boole IsInWorld() const
Gets whether or not this object is inside of it's world.
virtual WorldObject * GetParentObject() const
Gets a pointer to the parent object controlling this proxy.
virtual Vector3 GetLocation() const
Gets this objects current location.
UInt32 GetNumAddedObjects() const
Gets the number of objects added to this AE since the last update.
This is used to store information about rotation in 3d space.
void SerializeError(const String &FailedTo, const String &ClassName, Boole SOrD)
Simply does some string concatenation, then throws an Exception.
Node AppendChild(NodeType Type=NodeElement)
Creates a Node and makes it a child of this one.
ObjectContainer RemovedObjects
Container of actors that have been removed since last frame.
virtual Physics::GhostProxy * GetGhostProxy() const
Gets a pointer to the physics portion of this AreaEffect.
virtual void SetCollisionGroupAndMask(const Int16 Group, const Int16 Mask)
Set the collision group and mask for the proxy to determine what it should collide with...
virtual void _Update()
Utility function for altering or checking the World Object every frame.
std::string String
A datatype used to a series of characters.
Attribute GetAttribute(const Char8 *Name) const
Attempt to get an Attribute on this Node with a given name.
virtual ~AreaEffect()
Class destructor.
virtual void SetOrientation(const Quaternion &Ori)
Sets the orientation of this object in parent space.
Node GetChild(const Char8 *Name) const
Attempt to get a child Node with a given name.