40 #ifndef _gravitywell_cpp
41 #define _gravitywell_cpp
43 #include "gravitywell.h"
45 #include "Physics/rigidproxy.h"
46 #include "Physics/ghostproxy.h"
47 #include "Physics/physicsmanager.h"
51 #include "exception.h"
52 #include "stringtool.h"
87 {
return Mezzanine::WO_AreaEffectGravityWell; }
104 (*AddedIt)->GetProxies(Mezzanine::PT_Physics_RigidProxy,RigidProxies);
105 for(
ProxyIterator ProxIt = RigidProxies.begin() ; ProxIt != RigidProxies.end() ; ++ProxIt )
116 Real Distance = 0,AppliedStrength = 0;
121 (*ObjIt)->GetProxies(Mezzanine::PT_Physics_RigidProxy,RigidProxies);
122 if( RigidProxies.empty() )
125 Distance = ObjectLoc.
Distance(SelfLoc);
126 Direction = (SelfLoc - ObjectLoc) / Distance;
141 for(
ProxyIterator ProxIt = RigidProxies.begin() ; ProxIt != RigidProxies.end() ; ++ProxIt )
146 if( 0 > AppliedStrength ) {
150 RigProx->
ApplyForce( Direction * (AppliedStrength * Mass ) );
161 (*RemovedIt)->GetProxies(Mezzanine::PT_Physics_RigidProxy,RigidProxies);
162 for(
ProxyIterator ProxIt = RigidProxies.begin() ; ProxIt != RigidProxies.end() ; ++ProxIt )
232 if( !PropertiesNode.
Empty() ) {
234 CurrAttrib = PropertiesNode.
GetAttribute(
"AttenAmount");
235 if( !CurrAttrib.
Empty() )
239 if( !CurrAttrib.
Empty() )
243 if( !CurrAttrib.
Empty() )
246 CurrAttrib = PropertiesNode.
GetAttribute(
"AllowWorldGravity");
247 if( !CurrAttrib.
Empty() )
261 {
return "GravityWell"; }
288 {
delete ToBeDestroyed; }