MezzanineEngine March 18, 2012

Mezzanine::FieldOfForce Class Reference

This is field that applies force in a direction, and doesn't tamper with gravity. More...

#include <areaeffect.h>

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

List of all members.

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.

Detailed Description

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.


Constructor & Destructor Documentation

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

Class Constructor.

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

Definition at line 584 of file areaeffect.cpp.


Member Function Documentation

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.

Returns:
Returns a Real value

Definition at line 681 of file areaeffect.cpp.

Vector3 Mezzanine::FieldOfForce::GetAttenuationSource ( ) const [virtual]

Gets the source of the force for calculating attenuation.

Returns:
Returns a Vector3 representing the source of the attenuating force.

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.

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

Definition at line 676 of file areaeffect.cpp.

Vector3 Mezzanine::FieldOfForce::GetDirectionOfForce ( ) [virtual]

Gets the currenly set direction force is to be applied.

Returns:
Returns a vector3 representing the direction of force in this field.

Definition at line 664 of file areaeffect.cpp.

Real Mezzanine::FieldOfForce::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 654 of file areaeffect.cpp.

WorldAndSceneObjectType Mezzanine::FieldOfForce::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 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.

Parameters:
AmountThe amount of force that is dropped off per 1 unit of distance objects are from the AE source.
StyleThe style of attenuation to apply, see the AttenuationStyle enum for more details.
SourceA 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.

Parameters:
ForceDirectionA 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.

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

Definition at line 649 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