Spinning Topp Logo BlackTopp Studios
inc
rigidproxy.cpp
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 _rigidproxy_cpp
41 #define _rigidproxy_cpp
42 
43 #include "Physics/rigidproxy.h"
44 #include "Physics/collisionshape.h"
45 #include "Physics/physicsmanager.h"
46 #include "Physics/collisionshapemanager.h"
47 
48 #include "enumerations.h"
49 #include "stringtool.h"
50 
51 #include "Internal/motionstate.h.cpp"
52 
53 #include <btBulletDynamicsCommon.h>
54 #include <BulletSoftBody/btSoftRigidDynamicsWorld.h>
55 
56 namespace Mezzanine
57 {
58  namespace Physics
59  {
60  RigidProxy::RigidProxy(const UInt32 ID, const Real Mass, PhysicsManager* Creator) :
61  CollidableProxy(ID,Creator),
62  PhysicsRigidBody(NULL)
63  {
64  this->CreateRigidObject(Mass);
65  }
66 
67  RigidProxy::RigidProxy(const UInt32 ID, const Real Mass, CollisionShape* Shape, PhysicsManager* Creator) :
68  CollidableProxy(ID,Creator),
69  PhysicsRigidBody(NULL)
70  {
71  this->CreateRigidObject(Mass);
72  this->SetCollisionShape(Shape);
73  }
74 
75  RigidProxy::RigidProxy(const XML::Node& SelfRoot, PhysicsManager* Creator) :
76  CollidableProxy(Creator),
77  PhysicsRigidBody(NULL)
78  {
79  this->CreateRigidObject(1);
80  this->ProtoDeSerialize(SelfRoot);
81  }
82 
84  {
85  if( this->IsInWorld() )
86  this->RemoveFromWorld();
87 
88  delete this->PhysicsRigidBody->getMotionState();
89  delete this->PhysicsRigidBody;
90  }
91 
93  {
94  this->PhysicsRigidBody = new btRigidBody(Mass, NULL/* MotionState */, NULL/* CollisionShape */);
95  this->PhysicsRigidBody->setMotionState( new Internal::MultiMotionState( this ) );
96  this->PhysicsRigidBody->setUserPointer( static_cast<CollidableProxy*>( this ) );
97  if(0.0 == Mass) {
98  this->PhysicsRigidBody->setCollisionFlags( btCollisionObject::CF_STATIC_OBJECT );
99  this->CollisionGroup = Physics::CF_StaticFilter;
100  this->CollisionMask = Physics::CF_AllFilter & ~Physics::CF_StaticFilter;
101  }else{
102  this->PhysicsRigidBody->setCollisionFlags( this->PhysicsRigidBody->getCollisionFlags() & (~btCollisionObject::CF_STATIC_OBJECT) );
103  // Use default group and mask
104  }
105  this->SetGravity( this->Manager->GetWorldGravity() );
106  }
107 
108  ///////////////////////////////////////////////////////////////////////////////
109  // Utility
110 
112  {
113  return Mezzanine::PT_Physics_RigidProxy;
114  }
115 
117  {
118  if( !this->IsInWorld() ) {
119  // Preserve gravity when adding
120  Vector3 Grav = this->GetGravity();
121  this->Manager->_GetPhysicsWorldPointer()->addRigidBody( this->PhysicsRigidBody, this->CollisionGroup, this->CollisionMask );
122  this->SetGravity(Grav);
123  }
124  }
125 
127  {
128  if( this->IsInWorld() ) {
129  this->Manager->_GetPhysicsWorldPointer()->removeRigidBody( this->PhysicsRigidBody );
130  }
131  }
132 
133  ///////////////////////////////////////////////////////////////////////////////
134  // Collision Settings
135 
137  {
138  if( Shape != NULL ) {
139  if(CollisionShape::ST_StaticTriMesh != Shape->GetType()) {
140  Real Mass = this->PhysicsRigidBody->getInvMass();
141  if(0 != Mass) {
142  Mass = 1 / Mass;
143  }
144  btVector3 Inertia(0,0,0);
145  Shape->_GetInternalShape()->calculateLocalInertia(Mass,Inertia);
146  this->PhysicsRigidBody->setMassProps(Mass,Inertia);
148  this->PhysicsRigidBody->updateInertiaTensor();
149  }else{
151  }
153  { CollisionShapeManager::GetSingletonPtr()->StoreShape(Shape); }
154  }else{
156  }
157  }
158 
159  ///////////////////////////////////////////////////////////////////////////////
160  // Movement Factors
161 
163  { this->PhysicsRigidBody->setLinearFactor(Factor.GetBulletVector3()); }
164 
166  { return Vector3(this->PhysicsRigidBody->getLinearFactor()); }
167 
169  { this->PhysicsRigidBody->setAngularFactor(Factor.GetBulletVector3()); }
170 
172  { return Vector3(this->PhysicsRigidBody->getAngularFactor()); }
173 
174  ///////////////////////////////////////////////////////////////////////////////
175  // Rigid Physics Properties
176 
177  void RigidProxy::SetMass(Real NewMass)
178  { this->PhysicsRigidBody->setMassProps( NewMass, btVector3(1,1,1) / this->PhysicsRigidBody->getInvInertiaDiagLocal() ); }
179 
181  { return ( this->PhysicsRigidBody->getInvMass() != 0 ? 1 / this->PhysicsRigidBody->getInvMass() : 0 ); }
182 
183  void RigidProxy::SetDamping(const Real LinDamping, const Real AngDamping)
184  { this->PhysicsRigidBody->setDamping( LinDamping, AngDamping ); }
185 
187  { return this->PhysicsRigidBody->getLinearDamping(); }
188 
190  { return this->PhysicsRigidBody->getAngularDamping(); }
191 
193  { this->PhysicsRigidBody->setLinearVelocity( LinVel.GetBulletVector3() ); }
194 
196  { return Vector3(this->PhysicsRigidBody->getLinearVelocity()); }
197 
199  { this->PhysicsRigidBody->setAngularVelocity( AngVel.GetBulletVector3() ); }
200 
202  { return Vector3(this->PhysicsRigidBody->getAngularVelocity()); }
203 
204  void RigidProxy::SetGravity(const Vector3& Gravity)
205  { this->PhysicsRigidBody->setGravity( Gravity.GetBulletVector3() ); }
206 
208  { return Vector3(this->PhysicsRigidBody->getGravity()); }
209 
210  void RigidProxy::ApplyForce(const Vector3& Force)
211  { this->PhysicsRigidBody->applyCentralForce( Force.GetBulletVector3() ); }
212 
214  { return Vector3(this->PhysicsRigidBody->getTotalForce()); }
215 
216  void RigidProxy::ApplyTorque(const Vector3& Torque)
217  { this->PhysicsRigidBody->applyTorque( Torque.GetBulletVector3() ); }
218 
220  { return Vector3(this->PhysicsRigidBody->getTotalTorque()); }
221 
222  ///////////////////////////////////////////////////////////////////////////////
223  // Sticky Data
224 
225  /*
226  void RigidProxy::SetStickyData(const Whole& MaxNumContacts)
227  {
228  if(MaxNumContacts > 0) StickyContacts->MaxNumContacts = MaxNumContacts;
229  else ClearStickyContacts();
230  }
231 
232  void RigidProxy::ClearStickyContacts()
233  {
234  if(0 == StickyContacts->StickyConstraints.size())
235  return;
236  btDiscreteDynamicsWorld* BulletWorld = Entresol::GetSingletonPtr()->GetPhysicsManager()->GetPhysicsWorldPointer();
237  for( std::vector<StickyConstraint*>::iterator SCit = StickyContacts->StickyConstraints.begin() ; SCit != StickyContacts->StickyConstraints.end() ; ++SCit )
238  {
239  BulletWorld->removeConstraint((*SCit)->GetConstraintBase());
240 
241  ActorRigid* OtherActor = (*SCit)->GetActorA() != Parent ? (*SCit)->GetActorA() : (*SCit)->GetActorB();
242  StickyData* OtherSettings = OtherActor->GetPhysicsSettings()->GetStickyData();
243  for( std::vector<StickyConstraint*>::iterator SCit2 = OtherSettings->StickyConstraints.begin() ; SCit2 != OtherSettings->StickyConstraints.end() ; ++SCit2 )
244  {
245  if( (*SCit) == (*SCit2) )
246  {
247  OtherSettings->StickyConstraints.erase(SCit2);
248  break;
249  }
250  }
251 
252  delete (*SCit);
253  }
254  StickyContacts->StickyConstraints.clear();
255  StickyContacts->CreationQueue.clear();
256  }
257 
258  StickyData* RigidProxy::GetStickyData() const
259  { return StickyContacts; }
260  */
261 
262  ///////////////////////////////////////////////////////////////////////////////
263  // Transform Syncronization
264 
266  { static_cast<Internal::MultiMotionState*>( this->PhysicsRigidBody->getMotionState() )->AddSyncObject(ToBeAdded); }
267 
269  { return static_cast<Internal::MultiMotionState*>( this->PhysicsRigidBody->getMotionState() )->GetSyncObject(Index); }
270 
272  { return static_cast<Internal::MultiMotionState*>( this->PhysicsRigidBody->getMotionState() )->GetNumSyncObjects(); }
273 
275  { static_cast<Internal::MultiMotionState*>( this->PhysicsRigidBody->getMotionState() )->RemoveSyncObject(ToBeRemoved); }
276 
278  { static_cast<Internal::MultiMotionState*>( this->PhysicsRigidBody->getMotionState() )->RemoveAllSyncObjects(); }
279 
280  ///////////////////////////////////////////////////////////////////////////////
281  // Serialization
282 
284  {
285  this->CollidableProxy::ProtoSerialize(SelfRoot);
286  // We're at the base implementation, so no calling of child implementations
287  XML::Node PropertiesNode = SelfRoot.AppendChild( RigidProxy::GetSerializableName() + "Properties" );
288 
289  if( PropertiesNode.AppendAttribute("Version").SetValue("1") &&
290  PropertiesNode.AppendAttribute("Mass").SetValue( this->GetMass() ) &&
291  PropertiesNode.AppendAttribute("LinearDamping").SetValue( this->GetLinearDamping() ) &&
292  PropertiesNode.AppendAttribute("AngularDamping").SetValue( this->GetAngularDamping() ) )
293  {
294  XML::Node LinVelNode = PropertiesNode.AppendChild("LinearVelocty");
295  this->GetLinearVelocity().ProtoSerialize( LinVelNode );
296 
297  XML::Node AngVelNode = PropertiesNode.AppendChild("AngularVelocity");
298  this->GetAngularVelocity().ProtoSerialize( AngVelNode );
299 
300  XML::Node LinFactNode = PropertiesNode.AppendChild("LinearFactor");
301  this->GetLinearMovementFactor().ProtoSerialize( LinFactNode );
302 
303  XML::Node AngFactNode = PropertiesNode.AppendChild("AngularFactor");
304  this->GetAngularMovementFactor().ProtoSerialize( AngFactNode );
305 
306  XML::Node ForceNode = PropertiesNode.AppendChild("Force");
307  this->GetAppliedForce().ProtoSerialize( ForceNode );
308 
309  XML::Node TorqueNode = PropertiesNode.AppendChild("Torque");
310  this->GetAppliedTorque().ProtoSerialize( TorqueNode );
311 
312  XML::Node GravityNode = PropertiesNode.AppendChild("Gravity");
313  this->GetGravity().ProtoSerialize( GravityNode );
314 
315  return;
316  }else{
317  SerializeError("Create XML Attribute Values",RigidProxy::GetSerializableName() + "Properties",true);
318  }
319  }
320 
322  {
323  this->PhysicsRigidBody->clearForces();
324  this->CollidableProxy::ProtoDeSerialize(SelfRoot);
325  // We're at the base implementation, so no calling of child implementations
326  XML::Attribute CurrAttrib;
327  XML::Node PropertiesNode = SelfRoot.GetChild( RigidProxy::GetSerializableName() + "Properties" );
328 
329  if( !PropertiesNode.Empty() ) {
330  if(PropertiesNode.GetAttribute("Version").AsInt() == 1) {
331  Real LinDam = 0, AngDam = 0;
332 
333  CurrAttrib = PropertiesNode.GetAttribute("Mass");
334  if( !CurrAttrib.Empty() )
335  this->SetMass( CurrAttrib.AsReal() );
336 
337  CurrAttrib = PropertiesNode.GetAttribute("LinearDamping");
338  if( !CurrAttrib.Empty() )
339  LinDam = CurrAttrib.AsReal();
340 
341  CurrAttrib = PropertiesNode.GetAttribute("AngularDamping");
342  if( !CurrAttrib.Empty() )
343  AngDam = CurrAttrib.AsReal();
344 
345  this->SetDamping(LinDam,AngDam);
346 
347  // Get the properties that need their own nodes
348  XML::Node LinVelNode = PropertiesNode.GetChild("LinearVelocty").GetFirstChild();
349  if( !LinVelNode.Empty() ) {
350  Vector3 LinVel(LinVelNode);
351  this->SetLinearVelocity(LinVel);
352  }
353 
354  XML::Node AngVelNode = PropertiesNode.GetChild("AngularVelocity").GetFirstChild();
355  if( !AngVelNode.Empty() ) {
356  Vector3 AngVel(AngVelNode);
357  this->SetAngularVelocity(AngVel);
358  }
359 
360  XML::Node LinFactNode = PropertiesNode.GetChild("LinearFactor").GetFirstChild();
361  if( !LinFactNode.Empty() ) {
362  Vector3 LinFact(LinFactNode);
363  this->SetLinearMovementFactor(LinFact);
364  }
365 
366  XML::Node AngFactNode = PropertiesNode.GetChild("AngularFactor").GetFirstChild();
367  if( !AngFactNode.Empty() ) {
368  Vector3 AngFact(AngFactNode);
369  this->SetAngularMovementFactor(AngFact);
370  }
371 
372  XML::Node ForceNode = PropertiesNode.GetChild("Force").GetFirstChild();
373  if( !ForceNode.Empty() ) {
374  Vector3 Force(ForceNode);
375  this->ApplyForce(Force);
376  }
377 
378  XML::Node TorqueNode = PropertiesNode.GetChild("Torque").GetFirstChild();
379  if( !TorqueNode.Empty() ) {
380  Vector3 Torque(TorqueNode);
381  this->ApplyTorque(Torque);
382  }
383 
384  XML::Node GravityNode = PropertiesNode.GetChild("Gravity").GetFirstChild();
385  if( !GravityNode.Empty() ) {
386  Vector3 Gravity(GravityNode);
387  this->SetGravity(Gravity);
388  }
389  }else{
390  MEZZ_EXCEPTION(ExceptionBase::INVALID_VERSION_EXCEPTION,"Incompatible XML Version for " + (RigidProxy::GetSerializableName() + "Properties" ) + ": Not Version 1.");
391  }
392  }else{
393  MEZZ_EXCEPTION(ExceptionBase::II_IDENTITY_NOT_FOUND_EXCEPTION,RigidProxy::GetSerializableName() + "Properties" + " was not found in the provided XML node, which was expected.");
394  }
395  }
396 
398  { return RigidProxy::GetSerializableName(); }
399 
401  { return "RigidProxy"; }
402 
403  ///////////////////////////////////////////////////////////////////////////////
404  // Internal Methods
405 
406  btRigidBody* RigidProxy::_GetPhysicsObject() const
407  { return this->PhysicsRigidBody; }
408 
409  btCollisionObject* RigidProxy::_GetBasePhysicsObject() const
410  { return this->PhysicsRigidBody; }
411  }// Physics
412 }// Mezzanine
413 
414 #endif
This is the base class for all collision shapes.
virtual UInt32 GetNumSyncObjects() const
Gets the number of WorldProxies being sync'd to this RigidProxy.
Definition: rigidproxy.cpp:271
Attribute AppendAttribute(const Char8 *Name)
Creates an Attribute and puts it at the end of this Nodes attributes.
A light-weight handle for manipulating attributes in DOM tree.
Definition: attribute.h:74
virtual void ApplyForce(const Vector3 &Force)
Push/Apply force to an proxy.
Definition: rigidproxy.cpp:210
RigidProxy(const UInt32 ID, const Real Mass, PhysicsManager *Creator)
Class Constructor.
Definition: rigidproxy.cpp:60
This is an interface for all 3D objects that can have their full transforms manipulated.
virtual Vector3 GetAngularVelocity() const
Gets the Angular Velocity of this proxy.
Definition: rigidproxy.cpp:201
virtual void RemoveAllSyncObjects()
Removes all WorldProxies being sync'd to this RigidProxy.
Definition: rigidproxy.cpp:277
virtual void SetMass(const Real Mass)
Change the mass of the proxy.
Definition: rigidproxy.cpp:177
virtual Vector3 GetAppliedForce() const
Get the total Force currently being applied to this proxy.
Definition: rigidproxy.cpp:213
Indicates the class is a StaticMeshCollisionShape.
virtual void ProtoSerializeProperties(XML::Node &SelfRoot) const
Convert the properties of this class to an XML::Node ready for serialization.
Definition: rigidproxy.cpp:283
PhysicsManager * Manager
This is a pointer to the physics manager that created and owns this proxy.
Thrown when the requested identity could not be found.
Definition: exception.h:94
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.
Definition: exception.h:3048
virtual ~RigidProxy()
Class Destructor.
Definition: rigidproxy.cpp:83
virtual void SetLinearMovementFactor(const Vector3 &Factor)
Restricts movement on the axis or axies of your choice.
Definition: rigidproxy.cpp:162
virtual Mezzanine::ProxyType GetProxyType() const
Accessor for the type of proxy.
Definition: rigidproxy.cpp:111
virtual void ProtoDeSerialize(const XML::Node &SelfRoot)
Take the data stored in an XML Node and overwrite this object with it.
Definition: worldproxy.cpp:114
virtual Vector3 GetGravity() const
Gets the gravity being applied to this proxy.
Definition: rigidproxy.cpp:207
Thrown when a version is accessed/parsed/required and it cannot work correctly or is missing...
Definition: exception.h:112
virtual Vector3 GetAppliedTorque() const
Get the total Torque currently being applied to this proxy.
Definition: rigidproxy.cpp:219
virtual btCollisionShape * _GetInternalShape() const
Gets the internal shape pointer this collision shape is based on.
virtual void SetLinearVelocity(const Vector3 &LinVel)
Sets the Linear Velocity of this proxy.
Definition: rigidproxy.cpp:192
Any global enumerations shared between multiple classes is to be declared here.
virtual void SetAngularVelocity(const Vector3 &AngVel)
Sets the Angular Velocity of this proxy.
Definition: rigidproxy.cpp:198
bool Empty() const
Is this storing anything at all?
virtual void AddSyncObject(TransformableObject *ToBeAdded)
Adds a TransformableObject that will force it's transform to sync with this RigidProxy.
Definition: rigidproxy.cpp:265
virtual void ProtoSerialize(XML::Node &ParentNode) const
Convert this class to an XML::Node ready for serialization.
Definition: worldproxy.cpp:84
Vector3 GetWorldGravity()
Gets the gravity.
virtual void AddToWorld()
Performs all the necessary task to ensure this object is connected to it's respective world and ready...
Definition: rigidproxy.cpp:116
float Real
A Datatype used to represent a real floating point number.
Definition: datatypes.h:141
bool SetValue(const Char8 *rhs)
Set the value of this.
virtual void SetCollisionShape(CollisionShape *Shape)
Sets the collision shape to be used.
Definition: rigidproxy.cpp:136
static CollisionShapeManager * GetSingletonPtr()
Fetches a pointer to the singleton.
Definition: singleton.h:97
Int16 CollisionGroup
The classifications pertaining to this object in regards to collisions.
btVector3 GetBulletVector3() const
Gets a Bullet vector3.
Definition: vector3.cpp:555
A light-weight handle for manipulating nodes in DOM tree.
Definition: node.h:89
btRigidBody * PhysicsRigidBody
RigidBody proxy used by the internal physics.
Definition: rigidproxy.h:107
int AsInt(int def=0) const
Attempts to convert the value of the attribute to an int and returns the results. ...
ProxyType
Used by all World proxies to describe what their derived types are.
Definition: enumerations.h:91
uint32_t UInt32
An 32-bit unsigned integer.
Definition: datatypes.h:126
bool Empty() const
Is this storing anything at all?
virtual Real GetAngularDamping() const
Get the Angular damping.
Definition: rigidproxy.cpp:189
virtual void SetAngularMovementFactor(const Vector3 &Factor)
Restricts movement on the axis or axes of your choice.
Definition: rigidproxy.cpp:168
virtual btRigidBody * _GetPhysicsObject() const
Accessor for the internal rigid body physics proxy.
Definition: rigidproxy.cpp:406
virtual btCollisionObject * _GetBasePhysicsObject() const
Accessor for the internal physics object.
Definition: rigidproxy.cpp:409
Real AsReal(Real def=0) const
Attempts to convert the value of the attribute to a Real and returns the results. ...
virtual void CreateRigidObject(const Real Mass)
Used to create the physics representation of the rigid body.
Definition: rigidproxy.cpp:92
virtual void RemoveSyncObject(TransformableObject *ToBeRemoved)
Removes a proxy being sync'd, so it will no longer match it's transform with this RigidProxy...
Definition: rigidproxy.cpp:274
static String GetSerializableName()
Get the name of the the XML tag the proxy class will leave behind as its instances are serialized...
Definition: rigidproxy.cpp:400
btSoftRigidDynamicsWorld * _GetPhysicsWorldPointer()
This returns a pointer to the bullet physics world. This is for internal use only.
virtual void ProtoDeSerializeProperties(const XML::Node &SelfRoot)
Take the data stored in an XML Node and overwrite the properties of this object with it...
Definition: rigidproxy.cpp:321
virtual Vector3 GetLinearVelocity() const
Gets the Linear Velocity of this proxy.
Definition: rigidproxy.cpp:195
This is a proxy from which physics objects that can collide with each other are handled.
This is simply a place for storing all the Physics Related functions.
virtual String GetDerivedSerializableName() const
Gets the most derived serializable name of this WorldProxy.
Definition: rigidproxy.cpp:397
This is used to represent a point in space, or a vector through space.
Definition: vector3.h:77
The bulk of the engine components go in this namspace.
Definition: actor.cpp:56
virtual void RemoveFromWorld()
Unhooks this proxy from it's respective world.
Definition: rigidproxy.cpp:126
virtual Vector3 GetAngularMovementFactor() const
Gets the current angular factors being applied to this actor.
Definition: rigidproxy.cpp:171
virtual Boole IsInWorld() const
Gets whether or not this object is inside of it's world.
Int16 CollisionMask
Stores the kind of World Objects that can collide with each other.
virtual Real GetLinearDamping() const
Get the linear damping.
Definition: rigidproxy.cpp:186
virtual void SetGravity(const Vector3 &Gravity)
Sets the gravity for only this proxy.
Definition: rigidproxy.cpp:204
virtual void SetCollisionShape(CollisionShape *Shape)
Sets the collision shape to be used.
virtual void SetDamping(const Real LinDamping, const Real AngDamping)
Sets the Damping for this proxy.
Definition: rigidproxy.cpp:183
virtual TransformableObject * GetSyncObject(const UInt32 Index) const
Gets a TransformableObject being sync'd to this RigidProxy by it's index.
Definition: rigidproxy.cpp:268
void SerializeError(const String &FailedTo, const String &ClassName, Boole SOrD)
Simply does some string concatenation, then throws an Exception.
virtual void ApplyTorque(const Vector3 &Torque)
Spin/Apply torque to an proxy.
Definition: rigidproxy.cpp:216
Node AppendChild(NodeType Type=NodeElement)
Creates a Node and makes it a child of this one.
virtual CollisionShape::ShapeType GetType() const =0
Gets the type of Collision shape this is.
std::string String
A datatype used to a series of characters.
Definition: datatypes.h:159
virtual Vector3 GetLinearMovementFactor() const
Gets the current linear factors being applied to this actor.
Definition: rigidproxy.cpp:165
Attribute GetAttribute(const Char8 *Name) const
Attempt to get an Attribute on this Node with a given name.
void ProtoSerialize(XML::Node &CurrentRoot) const
Convert this class to an XML::Node ready for serialization.
Definition: vector3.cpp:588
Node GetChild(const Char8 *Name) const
Attempt to get a child Node with a given name.
virtual Real GetMass() const
Get the total Mass of the proxy.
Definition: rigidproxy.cpp:180