A Modifier applying a linear force on particles. More...
Public Member Functions | |
LinearForce (Zone *zone=NULL, ModifierTrigger trigger=INSIDE_ZONE, const Vector3D &force=Vector3D(), ForceFactor type=FACTOR_NONE, ModelParam param=PARAM_SIZE) | |
Default constructor for LinearForce. | |
void | setForce (const Vector3D &force) |
Sets the force vector. | |
void | setFactor (ForceFactor type, ModelParam param=PARAM_SIZE) |
Sets the factor type to apply to the force. | |
const Vector3D & | getForce () const |
Gets the force vector. | |
const Vector3D & | getTransformedForce () const |
Gets the transformed force vector. | |
ForceFactor | getFactorType () const |
Gets the factor multiplier of this LinearForce. | |
ModelParam | getFactorParam () const |
Gets the factor parameter of this LinearForce. | |
Static Public Member Functions | |
static LinearForce * | create (Zone *zone=NULL, ModifierTrigger trigger=INSIDE_ZONE, const Vector3D &force=Vector3D(), ForceFactor type=FACTOR_NONE, ModelParam param=PARAM_SIZE) |
Creates and registers a new LinearForce. | |
Protected Member Functions | |
virtual void | innerUpdateTransform () |
Updates all the parameters in the world coordinates. |
A Modifier applying a linear force on particles.
The force is identical from any points of the universe (only if the modifier is triggered).
In that way, particles under the influence of a LinearForce can theorically reach an infinite speed if not under the influence of a friction.
The force can be multiplied or not by a particle parameter either linearly or squared.
Note that this Modifier can be used to set a global gravity that can be updated for all groups at a time.
To do so, the LinearForce has to be used with the param : PARAM_MASS and the FactorType FACTOR_LINEAR.
Definition at line 59 of file SPK_LinearForce.h.
LinearForce | ( | Zone * | zone = NULL , |
|
ModifierTrigger | trigger = INSIDE_ZONE , |
|||
const Vector3D & | force = Vector3D() , |
|||
ForceFactor | type = FACTOR_NONE , |
|||
ModelParam | param = PARAM_SIZE | |||
) |
Default constructor for LinearForce.
zone | : the Zone of the LinearForce or NULL if no Zone | |
trigger | : the trigger of the LinearForce | |
force | : the force of the LinearForce | |
type | : the type of multiplier for the factor | |
param | : the parameter used as the factor (if type != FACTOR_NONE) |
LinearForce * create | ( | Zone * | zone = NULL , |
|
ModifierTrigger | trigger = INSIDE_ZONE , |
|||
const Vector3D & | force = Vector3D() , |
|||
ForceFactor | type = FACTOR_NONE , |
|||
ModelParam | param = PARAM_SIZE | |||
) | [static] |
Creates and registers a new LinearForce.
zone | : the Zone of the LinearForce or NULL if no Zone | |
trigger | : the trigger of the LinearForce | |
force | : the force of the LinearForce | |
type | : the type of multiplier for the factor | |
param | : the parameter used as the factor (if type != FACTOR_NONE) |
Definition at line 163 of file SPK_LinearForce.h.
ModelParam getFactorParam | ( | ) | const |
Gets the factor parameter of this LinearForce.
Definition at line 197 of file SPK_LinearForce.h.
ForceFactor getFactorType | ( | ) | const |
Gets the factor multiplier of this LinearForce.
Definition at line 192 of file SPK_LinearForce.h.
const Vector3D & getForce | ( | ) | const |
Gets the force vector.
Definition at line 182 of file SPK_LinearForce.h.
const Vector3D & getTransformedForce | ( | ) | const |
Gets the transformed force vector.
Definition at line 187 of file SPK_LinearForce.h.
void innerUpdateTransform | ( | ) | [protected, virtual] |
Updates all the parameters in the world coordinates.
This method can be overriden in derived classes of Transformable (By default it does nothing).
It is this method task to compute all parameters of the class that are dependent of the world transform.
Reimplemented from Transformable.
Definition at line 202 of file SPK_LinearForce.h.
void setFactor | ( | ForceFactor | type, | |
ModelParam | param = PARAM_SIZE | |||
) |
Sets the factor type to apply to the force.
type | : the type of multiplier for the factor | |
param | : the parameter of the Particle to use as the factor |
Definition at line 176 of file SPK_LinearForce.h.
void setForce | ( | const Vector3D & | force | ) |
Sets the force vector.
force | : the force vector |
Definition at line 170 of file SPK_LinearForce.h.