MezzanineEngine March 18, 2012

Mezzanine::GravityWell Class Reference

This is a gravity well implementation of the AreaEffect class. More...

#include <areaeffect.h>

Inheritance diagram for Mezzanine::GravityWell:
Mezzanine::AreaEffect Mezzanine::NonStaticWorldObject Mezzanine::AttachableChild Mezzanine::WorldObject Mezzanine::AttachableParent Mezzanine::AttachableBase Mezzanine::AttachableBase

List of all members.

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.

Detailed Description

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 & Destructor Documentation

Mezzanine::GravityWell::GravityWell ( const String name,
const Vector3 Location 
)

Constructor.

Basic initialization constructor.

Parameters:
nameThe name of the field.
LocationThe location of the AE field.

Definition at line 461 of file areaeffect.cpp.

Mezzanine::GravityWell::~GravityWell ( ) [virtual]

Destructor.

Class destructor.

Definition at line 470 of file areaeffect.cpp.


Member Function Documentation

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.

Returns:
Returns a bool indicating whether objects inside are affected by world gravity.

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.

Returns:
Returns a Real value

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.

Returns:
Returns the style of attenuation currently being used by this field.

Definition at line 566 of file areaeffect.cpp.

Real Mezzanine::GravityWell::GetFieldStrength ( ) const [virtual]

Gets the strength of the field.

Returns:
Returns a Real representing the value that is being multiplied by the direction to determine force appied to objects.

Definition at line 545 of file areaeffect.cpp.

WorldAndSceneObjectType Mezzanine::GravityWell::GetType ( ) const [virtual]

Gets the type of the World Object instance.

Returns:
Returns 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.

Remarks:
Changing this value while the field is in the world and active is not recommended.
Parameters:
WorldGravityIf 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.

Parameters:
AmountThe amount of force that is dropped off per 1 unit of distance objects are from the AE center.
StyleThe 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.

Parameters:
FieldStrengthThe strength the field will have when exerting force onto other objects.

Definition at line 540 of file areaeffect.cpp.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines