Spinning Topp Logo BlackTopp Studios
inc
softdebris.h
Go to the documentation of this file.
1 // © Copyright 2010 - 2016 BlackTopp Studios Inc.
2 /* This file is part of The Mezzanine Engine.
3 
4  The Mezzanine Engine is free software: you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation, either version 3 of the License, or
7  (at your option) any later version.
8 
9  The Mezzanine Engine is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with The Mezzanine Engine. If not, see <http://www.gnu.org/licenses/>.
16 */
17 /* The original authors have included a copy of the license specified above in the
18  'Docs' folder. See 'gpl.txt'
19 */
20 /* We welcome the use of the Mezzanine engine to anyone, including companies who wish to
21  Build professional software and charge for their product.
22 
23  However there are some practical restrictions, so if your project involves
24  any of the following you should contact us and we will try to work something
25  out:
26  - DRM or Copy Protection of any kind(except Copyrights)
27  - Software Patents You Do Not Wish to Freely License
28  - Any Kind of Linking to Non-GPL licensed Works
29  - Are Currently In Violation of Another Copyright Holder's GPL License
30  - If You want to change our code and not add a few hundred MB of stuff to
31  your distribution
32 
33  These and other limitations could cause serious legal problems if you ignore
34  them, so it is best to simply contact us or the Free Software Foundation, if
35  you have any questions.
36 
37  Joseph Toppi - toppij@gmail.com
38  John Blackwood - makoenergy02@gmail.com
39 */
40 #ifndef _softdebris_h
41 #define _softdebris_h
42 
43 /// @file
44 /// @brief This file contains the declaration for the debris class that will compress and deform.
45 
46 #include "debris.h"
47 
48 namespace Mezzanine
49 {
50  namespace Graphics
51  {
52  class EntityProxy;
53  }
54  namespace Physics
55  {
56  class SoftProxy;
57  }
58  ///////////////////////////////////////////////////////////////////////////////
59  /// @brief A deformable debris.
60  /// @details
61  ///////////////////////////////////////
62  class MEZZ_LIB SoftDebris : public Debris
63  {
64  protected:
65  /// @internal
66  /// @brief A pointer to the graphics representation of this debris.
68  /// @internal
69  /// @brief A pointer to the physics representation of this debris.
71 
72  /// @internal
73  /// @brief Common construction method for SoftDebris.
74  /// @param Mass The mass of the debris object.
75  virtual void CreateSoftDebris(const Real Mass);
76  /// @internal
77  /// @brief Destruction method for RigidDebris.
78  virtual void DestroySoftDebris();
79  public:
80  /// @brief Blank constructor.
81  /// @param TheWorld A pointer to the world this object belongs to.
82  SoftDebris(World* TheWorld);
83  /// @brief Class constructor.
84  /// @param Name The name to be given to this object.
85  /// @param Mass The mass of the debris object.
86  /// @param TheWorld A pointer to the world this object belongs to.
87  SoftDebris(const String& Name, const Real Mass, World* TheWorld);
88  /// @brief XML constructor.
89  /// @param SelfRoot An XML::Node containing the data to populate this class with.
90  /// @param TheWorld A pointer to the world this object belongs to.
91  SoftDebris(const XML::Node& SelfRoot, World* TheWorld);
92  /// @brief Class destructor.
93  virtual ~SoftDebris();
94 
95  ///////////////////////////////////////////////////////////////////////////////
96  // Utility and Configuration
97 
98  /// @copydoc Mezzanine::WorldObject::GetType() const
99  virtual WorldObjectType GetType() const;
100 
101  /// @brief Gets a pointer to the graphics portion of this debris.
102  /// @return Returns a pointer to the Entity proxy representing the graphics portion of this debris.
103  virtual Graphics::EntityProxy* GetEntityProxy() const;
104  /// @brief Gets a pointer to the physics portion of this debris.
105  /// @return Returns a pointer to the Soft proxy representing the physics portion of this debris.
106  virtual Physics::SoftProxy* GetSoftProxy() const;
107 
108  /// @copydoc Mezzanine::WorldObject::IsInWorld() const
109  virtual Boole IsInWorld() const;
110 
111  /// @copydoc Mezzanine::WorldObject::IsStatic() const
112  virtual Boole IsStatic() const;
113  /// @copydoc Mezzanine::WorldObject::IsKinematic() const
114  virtual Boole IsKinematic() const;
115 
116  /// @copydoc Mezzanine::WorldObject::GetProxies(ProxyContainer&)
117  virtual void GetProxies(ProxyContainer& Proxies);
118  /// @copydoc Mezzanine::WorldObject::GetProxies(const UInt32, ProxyContainer&)
119  virtual void GetProxies(const UInt32 Types, ProxyContainer& Proxies);
120 
121  ///////////////////////////////////////////////////////////////////////////////
122  // Working with the World
123 
124  /// @copydoc Mezzanine::WorldObject::AddToWorld()
125  virtual void AddToWorld();
126  /// @copydoc Mezzanine::WorldObject::RemoveFromWorld()
127  virtual void RemoveFromWorld();
128 
129  ///////////////////////////////////////////////////////////////////////////////
130  // Transform Methods
131 
132  /// @copydoc TransformableObject::SetLocation(const Vector3&)
133  virtual void SetLocation(const Vector3& Loc);
134  /// @copydoc TransformableObject::SetLocation(const Real, const Real, const Real)
135  virtual void SetLocation(const Real X, const Real Y, const Real Z);
136  /// @copydoc TransformableObject::GetLocation() const
137  virtual Vector3 GetLocation() const;
138  /// @copydoc TransformableObject::SetOrientation(const Quaternion&)
139  virtual void SetOrientation(const Quaternion& Ori);
140  /// @copydoc TransformableObject::SetOrientation(const Real, const Real, const Real, const Real)
141  virtual void SetOrientation(const Real X, const Real Y, const Real Z, const Real W);
142  /// @copydoc TransformableObject::GetOrientation() const
143  virtual Quaternion GetOrientation() const;
144  /// @copydoc TransformableObject::SetScale(const Vector3&)
145  virtual void SetScale(const Vector3& Sc);
146  /// @copydoc TransformableObject::SetScale(const Real, const Real, const Real)
147  virtual void SetScale(const Real X, const Real Y, const Real Z);
148  /// @copydoc TransformableObject::GetScale() const
149  virtual Vector3 GetScale() const;
150 
151  /// @copydoc TransformableObject::Translate(const Vector3&)
152  virtual void Translate(const Vector3& Trans);
153  /// @copydoc TransformableObject::Translate(const Real, const Real, const Real)
154  virtual void Translate(const Real X, const Real Y, const Real Z);
155  /// @copydoc TransformableObject::Yaw(const Real)
156  virtual void Yaw(const Real Angle);
157  /// @copydoc TransformableObject::Pitch(const Real)
158  virtual void Pitch(const Real Angle);
159  /// @copydoc TransformableObject::Roll(const Real)
160  virtual void Roll(const Real Angle);
161  /// @copydoc TransformableObject::Rotate(const Vector3&, const Real)
162  virtual void Rotate(const Vector3& Axis, const Real Angle);
163  /// @copydoc TransformableObject::Rotate(const Quaternion&)
164  virtual void Rotate(const Quaternion& Rotation);
165  /// @copydoc TransformableObject::Scale(const Vector3&)
166  virtual void Scale(const Vector3& Scale);
167  /// @copydoc TransformableObject::Scale(const Real, const Real, const Real)
168  virtual void Scale(const Real X, const Real Y, const Real Z);
169 
170  ///////////////////////////////////////////////////////////////////////////////
171  // Serialization
172 
173  /// @copydoc Mezzanine::WorldObject::ProtoSerializeProperties(XML::Node&) const
174  virtual void ProtoSerializeProperties(XML::Node& SelfRoot) const;
175  /// @copydoc Mezzanine::WorldObject::ProtoSerializeProxies(XML::Node&) const
176  virtual void ProtoSerializeProxies(XML::Node& SelfRoot) const;
177 
178  /// @copydoc Mezzanine::WorldObject::ProtoDeSerializeProperties(const XML::Node&)
179  virtual void ProtoDeSerializeProperties(const XML::Node& SelfRoot);
180  /// @copydoc Mezzanine::WorldObject::ProtoDeSerializeProxies(const XML::Node&)
181  virtual void ProtoDeSerializeProxies(const XML::Node& SelfRoot);
182 
183  /// @copydoc Mezzanine::WorldObject::GetDerivedSerializableName() const
184  virtual String GetDerivedSerializableName() const;
185  /// @copydoc Mezzanine::WorldObject::GetSerializableName()
186  static String GetSerializableName();
187 
188  ///////////////////////////////////////////////////////////////////////////////
189  // Internal Methods
190 
191  /// @copydoc Mezzanine::WorldObject::_Update()
192  virtual void _Update();
193  /// @copydoc Mezzanine::WorldObject::_NotifyProxyDestroyed(WorldProxy*)
194  virtual void _NotifyProxyDestroyed(WorldProxy* ToBeDestroyed);
195  };//SoftDebris
196 
197  ///////////////////////////////////////////////////////////////////////////////
198  /// @brief A base factory type for the creation of deformable Debris objects.
199  /// @details
200  ///////////////////////////////////////
202  {
203  public:
204  /// @brief Class constructor.
206  /// @brief Class destructor.
207  virtual ~SoftDebrisFactory();
208 
209  /// @copydoc DebrisFactory::GetTypeName() const
210  virtual String GetTypeName() const;
211 
212  /// @brief Creates a SoftDebris object.
213  /// @param Name The name to be given to this object.
214  /// @param Mass The mass of the debris object.
215  /// @param TheWorld A pointer to the world this object belongs to.
216  virtual SoftDebris* CreateSoftDebris(const String& Name, const Real Mass, World* TheWorld);
217  /// @brief Creates a SoftDebris object.
218  /// @param XMLNode The node of the xml document to construct from.
219  /// @param TheWorld A pointer to the world this object belongs to.
220  virtual SoftDebris* CreateSoftDebris(const XML::Node& XMLNode, World* TheWorld);
221 
222  /// @copydoc DebrisFactory::CreateDebris(const String&, World*, const NameValuePairMap&)
223  virtual Debris* CreateDebris(const String& Name, World* TheWorld, const NameValuePairMap& Params);
224  /// @copydoc DebrisFactory::CreateDebris(const XML::Node&, World*)
225  virtual Debris* CreateDebris(const XML::Node& XMLNode, World* TheWorld);
226  /// @copydoc DebrisFactory::DestroyDebris(Debris* ToBeDestroyed)
227  virtual void DestroyDebris(Debris* ToBeDestroyed);
228  };//SoftDebrisFactory
229 }//Mezzanine
230 
231 #endif
bool Boole
Generally acts a single bit, true or false.
Definition: datatypes.h:173
Graphics::EntityProxy * EntProx
A pointer to the graphics representation of this debris.
Definition: softdebris.h:67
A deformable debris.
Definition: softdebris.h:62
A base factory type for the creation of Debris objects.
Definition: debris.h:95
This is the proxy class for placing and manipulating a mesh in the scene.
Definition: entityproxy.h:62
float Real
A Datatype used to represent a real floating point number.
Definition: datatypes.h:141
std::vector< WorldProxy * > ProxyContainer
Basic container type for WorldProxy storage by this class.
Definition: worldobject.h:64
Physics::SoftProxy * SofProx
A pointer to the physics representation of this debris.
Definition: softdebris.h:70
A light-weight handle for manipulating nodes in DOM tree.
Definition: node.h:89
This is the proxy object for soft/compressable bodies.
Definition: softproxy.h:55
A simple world object without a large structure ideal for representing loose small objects...
Definition: debris.h:54
This is the base class for proxy objects belonging to the various 3D subsystems.
Definition: worldproxy.h:53
uint32_t UInt32
An 32-bit unsigned integer.
Definition: datatypes.h:126
This file contains the declaration for the debris class used to represent a small loose object in the...
This is used to represent a point in space, or a vector through space.
Definition: vector3.h:77
#define MEZZ_LIB
Some platforms require special decorations to denote what is exported/imported in a share library...
WorldObjectType
Used by various classes to help identify what class an object is.
Definition: enumerations.h:147
The bulk of the engine components go in this namspace.
Definition: actor.cpp:56
This class represents a world for objects to interact within.
Definition: world.h:74
A base factory type for the creation of deformable Debris objects.
Definition: softdebris.h:201
This is used to store information about rotation in 3d space.
Definition: quaternion.h:68
std::map< String, String > NameValuePairMap
This is a datatype mostly used for describing settings or parameters that can't be declared in advanc...
Definition: datatypes.h:209
std::string String
A datatype used to a series of characters.
Definition: datatypes.h:159