LinearForce Class Reference

A Modifier applying a linear force on particles. More...

Inheritance diagram for LinearForce:
Modifier Registerable Transformable BufferHandler

List of all members.

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 Vector3DgetForce () const
 Gets the force vector.
const Vector3DgetTransformedForce () 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 LinearForcecreate (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.

Detailed Description

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.

Since:
1.03.00

Definition at line 59 of file SPK_LinearForce.h.


Constructor & Destructor Documentation

LinearForce ( Zone zone = NULL,
ModifierTrigger  trigger = INSIDE_ZONE,
const Vector3D force = Vector3D(),
ForceFactor  type = FACTOR_NONE,
ModelParam  param = PARAM_SIZE 
)

Default constructor for LinearForce.

Parameters:
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)

Member Function Documentation

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.

Parameters:
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)
Returns:
A new registered LinearForce
Since:
1.04.00

Definition at line 163 of file SPK_LinearForce.h.

ModelParam getFactorParam (  )  const

Gets the factor parameter of this LinearForce.

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

Returns:
the factor multiplier of this LinearForce

Definition at line 192 of file SPK_LinearForce.h.

const Vector3D & getForce (  )  const

Gets the force vector.

Returns:
the force vector
Since:
1.03.02

Definition at line 182 of file SPK_LinearForce.h.

const Vector3D & getTransformedForce (  )  const

Gets the transformed force vector.

Returns:
the transformed force vector
Since:
1.03.02

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.

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

Parameters:
force : the force vector
Since:
1.03.02

Definition at line 170 of file SPK_LinearForce.h.


Generated on Wed Apr 27 21:09:26 2011 for SPARK Particle Engine by  doxygen 1.6.1