This is a gravity well implementation of the AreaEffect class. More...
#include <areaeffect.h>
Public Member Functions | |
| GravityWell (const String &name, const Vector3 &Location) | |
| Constructor. | |
| virtual | ~GravityWell () |
| Destructor. | |
| virtual void | ApplyEffect () |
| Applies the effect this field has to object inside. | |
| virtual bool | GetAllowWorldGravity () const |
| Gets whether or not world gravity is is removed for objects inside this field. | |
| virtual Real | GetAttenuationAmount () const |
| Gets the amount force is attenuated over distance. | |
| virtual Mezzanine::AttenuationStyle | GetAttenuationStyle () const |
| Gets the Style of attenuation applied. | |
| virtual Real | GetFieldStrength () const |
| Gets the strength of the field. | |
| virtual WorldAndSceneObjectType | GetType () const |
| virtual void | SetAllowWorldGravity (bool WorldGravity) |
| Sets whether or not world gravity should be removed for objects in this field. | |
| virtual void | SetAttenuation (const Real &Amount, const Mezzanine::AttenuationStyle &Style) |
| Sets the attenuation for this field. | |
| virtual void | SetFieldStrength (const Real &FieldStrength) |
| Sets the strenth of the field. | |
Protected Attributes | |
| bool | AllowWorldGrav |
| Should world gravity ne ignored. | |
| Real | AttenAmount |
| how much does the Gravity attenuate. | |
| Mezzanine::AttenuationStyle | AttenStyle |
| How does gravity. | |
| Real | Strength |
| The amount of force exerted on other objects. | |
This is a gravity well implementation of the AreaEffect class.
This class is not a gravity field, where gravity only pulls in one direction. Instead this class will always pull objects inside it towards the field center.
This class works best with sphere's, but can be made to work with any shape.
Definition at line 258 of file areaeffect.h.
Constructor.
Basic initialization constructor.
| name | The name of the field. |
| Location | The location of the AE field. |
Definition at line 461 of file areaeffect.cpp.
| Mezzanine::GravityWell::~GravityWell | ( | ) | [virtual] |
| void Mezzanine::GravityWell::ApplyEffect | ( | ) | [virtual] |
Applies the effect this field has to object inside.
This function defines the behavior for the class.
Implements Mezzanine::AreaEffect.
Definition at line 474 of file areaeffect.cpp.
| bool Mezzanine::GravityWell::GetAllowWorldGravity | ( | ) | const [virtual] |
Gets whether or not world gravity is is removed for objects inside this field.
Definition at line 555 of file areaeffect.cpp.
| Real Mezzanine::GravityWell::GetAttenuationAmount | ( | ) | const [virtual] |
Gets the amount force is attenuated over distance.
See SetAttenuation() for more details.
Definition at line 571 of file areaeffect.cpp.
| Mezzanine::AttenuationStyle Mezzanine::GravityWell::GetAttenuationStyle | ( | ) | const [virtual] |
Gets the Style of attenuation applied.
See the AttenuationStyle enum for more details.
Definition at line 566 of file areaeffect.cpp.
| Real Mezzanine::GravityWell::GetFieldStrength | ( | ) | const [virtual] |
Gets the strength of the field.
Definition at line 545 of file areaeffect.cpp.
| WorldAndSceneObjectType Mezzanine::GravityWell::GetType | ( | ) | const [virtual] |
Gets the type of the World Object instance.
Reimplemented from Mezzanine::AreaEffect.
Definition at line 576 of file areaeffect.cpp.
| void Mezzanine::GravityWell::SetAllowWorldGravity | ( | bool | WorldGravity | ) | [virtual] |
Sets whether or not world gravity should be removed for objects in this field.
| WorldGravity | If true, then forces exerted by this field will be added to the world gravity, otherwise world gravity for objects inside will be set to zero. |
Definition at line 550 of file areaeffect.cpp.
| void Mezzanine::GravityWell::SetAttenuation | ( | const Real & | Amount, |
| const Mezzanine::AttenuationStyle & | Style | ||
| ) | [virtual] |
Sets the attenuation for this field.
| Amount | The amount of force that is dropped off per 1 unit of distance objects are from the AE center. |
| Style | The style of attenuation to apply, see the AttenuationStyle enum for more details. |
Definition at line 560 of file areaeffect.cpp.
| void Mezzanine::GravityWell::SetFieldStrength | ( | const Real & | FieldStrength | ) | [virtual] |
Sets the strenth of the field.
The direction of the field is based on the current position of the object in the field. Once that direction is calculated it will be multiplied by this value to determine the force the field will apply to the object.
| FieldStrength | The strength the field will have when exerting force onto other objects. |
Definition at line 540 of file areaeffect.cpp.
1.7.3