This is field that applies force in a direction, and doesn't tamper with gravity. More...
#include <areaeffect.h>
Public Member Functions | |
| FieldOfForce (const String &name, const Vector3 &Location) | |
| Class Constructor. | |
| virtual | ~FieldOfForce () |
| Class Destructor. | |
| virtual void | ApplyEffect () |
| Applies the effect this field has to object inside. | |
| virtual Real | GetAttenuationAmount () const |
| Gets the amount force is attenuated over distance. | |
| virtual Vector3 | GetAttenuationSource () const |
| Gets the source of the force for calculating attenuation. | |
| virtual Mezzanine::AttenuationStyle | GetAttenuationStyle () const |
| Gets the Style of attenuation applied. | |
| virtual Vector3 | GetDirectionOfForce () |
| Gets the currenly set direction force is to be applied. | |
| virtual Real | GetFieldStrength () const |
| Gets the strength of the field. | |
| virtual WorldAndSceneObjectType | GetType () const |
| virtual void | SetAttenuation (const Real &Amount, const Mezzanine::AttenuationStyle &Style, const Vector3 &Source) |
| Sets the attenuation for this field. | |
| virtual void | SetDirectionOfForce (const Vector3 &ForceDirection) |
| Sets the direction force is to be applied within this field. | |
| virtual void | SetFieldStrength (const Real &FieldStrength) |
| Sets the strenth of the field. | |
Protected Attributes | |
| Real | AttenAmount |
| How much the Gravity weakens over distance. | |
| Vector3 | AttenSource |
| The user defined source if enabled. | |
| Mezzanine::AttenuationStyle | AttenStyle |
| How gravity weakens over distance, if at all. | |
| Vector3 | Direction |
| The direction the force is applied. | |
| Real | Strength |
| The amount of force exerted on other objects. | |
This is field that applies force in a direction, and doesn't tamper with gravity.
This class is similiar to a gravity well in that it can attenuate, but different in that the direction is constant, the source of force(for calculating attenuation) can be outside the field itself, and the direction is constant.
Placing the source of attenuation inside the field will cause the object to accelerate as it gets close to the source, and then will be applied less force(but in the same direction) as it moves from the source. This behavior makes this class good for creating a booster-like AE.
Definition at line 324 of file areaeffect.h.
Class Constructor.
| name | The name of the field. |
| Location | The location of the AE field. |
Definition at line 584 of file areaeffect.cpp.
| void Mezzanine::FieldOfForce::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 598 of file areaeffect.cpp.
| Real Mezzanine::FieldOfForce::GetAttenuationAmount | ( | ) | const [virtual] |
Gets the amount force is attenuated over distance.
See SetAttenuation() for more details.
Definition at line 681 of file areaeffect.cpp.
| Vector3 Mezzanine::FieldOfForce::GetAttenuationSource | ( | ) | const [virtual] |
Gets the source of the force for calculating attenuation.
Definition at line 686 of file areaeffect.cpp.
| Mezzanine::AttenuationStyle Mezzanine::FieldOfForce::GetAttenuationStyle | ( | ) | const [virtual] |
Gets the Style of attenuation applied.
See the AttenuationStyle enum for more details.
Definition at line 676 of file areaeffect.cpp.
| Vector3 Mezzanine::FieldOfForce::GetDirectionOfForce | ( | ) | [virtual] |
Gets the currenly set direction force is to be applied.
Definition at line 664 of file areaeffect.cpp.
| Real Mezzanine::FieldOfForce::GetFieldStrength | ( | ) | const [virtual] |
Gets the strength of the field.
Definition at line 654 of file areaeffect.cpp.
| WorldAndSceneObjectType Mezzanine::FieldOfForce::GetType | ( | ) | const [virtual] |
Gets the type of the World Object instance.
Reimplemented from Mezzanine::AreaEffect.
Definition at line 691 of file areaeffect.cpp.
| void Mezzanine::FieldOfForce::SetAttenuation | ( | const Real & | Amount, |
| const Mezzanine::AttenuationStyle & | Style, | ||
| const Vector3 & | Source | ||
| ) | [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 source. |
| Style | The style of attenuation to apply, see the AttenuationStyle enum for more details. |
| Source | A vector3 representing the source of force to use when calculating attenuation. |
Definition at line 669 of file areaeffect.cpp.
| void Mezzanine::FieldOfForce::SetDirectionOfForce | ( | const Vector3 & | ForceDirection | ) | [virtual] |
Sets the direction force is to be applied within this field.
| ForceDirection | A vector3 representing the direction force is to be applied. |
Definition at line 659 of file areaeffect.cpp.
| void Mezzanine::FieldOfForce::SetFieldStrength | ( | const Real & | FieldStrength | ) | [virtual] |
Sets the strenth of the field.
| FieldStrength | The strength the field will have when exerting force onto other objects. |
Definition at line 649 of file areaeffect.cpp.
1.7.3