Force Field. More...
#include <deForceField.h>
Public Types | |
| enum | eFieldTypes { eftLinear, eftRadial } |
Field types. More... | |
Public Member Functions | |
Constructors and Destructors | |
| deForceField (deForceFieldManager *manager) | |
| Creates a new prop field. | |
| virtual | ~deForceField () |
| Cleans up the prop field. | |
Management | |
| const decDVector & | GetPosition () const |
| Retrieves the position. | |
| void | SetPosition (const decDVector &position) |
| Sets the position. | |
| const decQuaternion & | GetOrientation () const |
| Retrieves the orientation. | |
| void | SetOrientation (const decQuaternion &orientation) |
| Sets the orientation. | |
| const decDVector & | GetSize () const |
| Retrieves the size. | |
| void | SetSize (const decDVector &size) |
| Sets the size. | |
| float | GetForce () const |
| Retrieves the force in newton. | |
| void | SetForce (float force) |
| Sets the force in newton. | |
| float | GetRadius () const |
| Retrieves the falloff radius. | |
| void | SetRadius (float radius) |
| Sets the radius. | |
| float | GetExponent () const |
| Retrieves the falloff exponent. | |
| void | SetExponent (float exponent) |
| Sets the exponent. | |
| float | GetFluctuation () const |
| Retrieves the strength of direction and strength fluctuation. | |
| void | SetFluctuation (float fluctuation) |
| Sets the strength of direction and strength fluctuation. | |
| float | GetDeviation () const |
| Retrieves the deviation due to vortex rotation in radians. | |
| void | SetDeviation (float deviation) |
| Sets the deviation due to vortex rotation in radians. | |
| decLayerMask & | GetLayerMask () |
| Retrieves the layer mask. | |
| void | NotifyLayerMaskChanged () |
| Notifies the peers that the layer mask changed. | |
| int | GetGroupNumber () const |
| Retrieves the group number or 0 if not set. | |
| void | SetGroupNumber (int groupNumber) |
| Sets the group number or 0 if not set. | |
| bool | CanHit (const decLayerMask &layerMask, int groupNumber) const |
| Determines if this force field type can hit another object represented by a layer mask and a group number. | |
| int | GetType () const |
| Retrieves the field type. | |
| void | SetType (int type) |
| Sets the field type. | |
| bool | GetEnabled () const |
| Determines if the field is enabled. | |
| void | SetEnabled (bool enabled) |
| Sets if the field is enabled. | |
System Peers | |
| deBasePhysicsForceField * | GetPhysicsForceField () const |
| Retrieves the physics system peer object. | |
| void | SetPhysicsForceField (deBasePhysicsForceField *peer) |
| Sets the physics system peer object. | |
Force Field.
Force fields apply a force to prop fields and particles of particle systems. The field is defined by an oriented box. The force is at the maximum inside the box and diminishes over a given radius outside of the box. The box is allowed to extends of zero length in which case the force field becomes an area force field or even a point force field. The force can be applied either linearily along the Z axis or radially from the center. You can specify a negative force strength to create a force field which attracts instead of repells. The force is measured in Newton. Force fields can be disabled explicitely avoiding the need to remove and add them all the time. This allows the game to maintain a pool of force fields for weather effects for example. Default settings are radial type, 0 size, 10N force, 1m radius, exponent 1 and disabled.
| deForceField::deForceField | ( | deForceFieldManager * | manager ) |
Creates a new prop field.
| virtual deForceField::~deForceField | ( | ) | [virtual] |
Cleans up the prop field.
| bool deForceField::CanHit | ( | const decLayerMask & | layerMask, |
| int | groupNumber | ||
| ) | const |
Determines if this force field type can hit another object represented by a layer mask and a group number.
The layer mask and the group number of both entities are checked for a match. Group numbers match only if neither of them is 0.
| float deForceField::GetDeviation | ( | ) | const [inline] |
Retrieves the deviation due to vortex rotation in radians.
| bool deForceField::GetEnabled | ( | ) | const [inline] |
Determines if the field is enabled.
| float deForceField::GetExponent | ( | ) | const [inline] |
Retrieves the falloff exponent.
| float deForceField::GetFluctuation | ( | ) | const [inline] |
Retrieves the strength of direction and strength fluctuation.
| float deForceField::GetForce | ( | ) | const [inline] |
Retrieves the force in newton.
| int deForceField::GetGroupNumber | ( | ) | const [inline] |
Retrieves the group number or 0 if not set.
| decLayerMask& deForceField::GetLayerMask | ( | ) | [inline] |
Retrieves the layer mask.
| const decQuaternion& deForceField::GetOrientation | ( | ) | const [inline] |
Retrieves the orientation.
| deBasePhysicsForceField* deForceField::GetPhysicsForceField | ( | ) | const [inline] |
Retrieves the physics system peer object.
| const decDVector& deForceField::GetPosition | ( | ) | const [inline] |
Retrieves the position.
| float deForceField::GetRadius | ( | ) | const [inline] |
Retrieves the falloff radius.
| const decDVector& deForceField::GetSize | ( | ) | const [inline] |
Retrieves the size.
| int deForceField::GetType | ( | ) | const [inline] |
Retrieves the field type.
| void deForceField::NotifyLayerMaskChanged | ( | ) |
Notifies the peers that the layer mask changed.
| void deForceField::SetDeviation | ( | float | deviation ) |
Sets the deviation due to vortex rotation in radians.
| void deForceField::SetEnabled | ( | bool | enabled ) |
Sets if the field is enabled.
| void deForceField::SetExponent | ( | float | exponent ) |
Sets the exponent.
| void deForceField::SetFluctuation | ( | float | fluctuation ) |
Sets the strength of direction and strength fluctuation.
| void deForceField::SetForce | ( | float | force ) |
Sets the force in newton.
| void deForceField::SetGroupNumber | ( | int | groupNumber ) |
Sets the group number or 0 if not set.
| void deForceField::SetOrientation | ( | const decQuaternion & | orientation ) |
Sets the orientation.
| void deForceField::SetPhysicsForceField | ( | deBasePhysicsForceField * | peer ) |
Sets the physics system peer object.
| void deForceField::SetPosition | ( | const decDVector & | position ) |
Sets the position.
| void deForceField::SetRadius | ( | float | radius ) |
Sets the radius.
| void deForceField::SetSize | ( | const decDVector & | size ) |
Sets the size.
| void deForceField::SetType | ( | int | type ) |
Sets the field type.
1.7.2