Modifier Class Reference

A abstract class that defines a physical object acting on particles. More...

Inheritance diagram for Modifier:
Registerable Transformable BufferHandler Collision Destroyer LinearForce ModifierGroup Obstacle PointMass Rotator Vortex

List of all members.

Public Member Functions

 Modifier (int availableTriggers=ALWAYS, ModifierTrigger trigger=ALWAYS, bool needsIntersection=false, bool needsNormal=false, Zone *zone=NULL)
 Constructor of Modifier.
virtual ~Modifier ()
 Destructor of Modifier.
void setActive (bool active)
 Sets this Modifier active or not.
void setZone (Zone *zone, bool full=false)
 Sets the Zone of this Modifier.
bool setTrigger (ModifierTrigger trigger)
 Sets the trigger of this Modifier.
void setLocalToSystem (bool local)
 Sets whether to consider this modifier local to a system or not.
bool isActive () const
 Tells whether this Modifier is active or not.
ZonegetZone () const
 Gets the Zone of this Modifier.
ModifierTrigger getTrigger () const
 Gets the trigger of this Modifier.
int getAvailableTriggers () const
 Gets a flag containing all the available triggers for this Modifier.
bool isFullZone () const
 Tells whether the Zone of this Modifier is considerered to be full or not.
bool isLocalToSystem () const
 Tells whether this modifier is considered as being local to a system or not.
virtual RegisterablefindByName (const std::string &name)
 Finds a registerable with its name recursively from this registerable.

Protected Member Functions

virtual void registerChildren (bool registerAll)
 Registers the children of this Registerable.
virtual void destroyChildren (bool keepChildren)
 Destroys the children of this Registerable.
virtual void propagateUpdateTransform ()
 Propagates the update of the transform to transformable children of this transformable.

Protected Attributes

bool needsIntersection
 true if the Modifier needs the intersection computation, false if not
bool needsNormal
 true if the Modifier needs the normal computation, false if not
ModifierTrigger trigger
 the current trigger of this Modifier
const int availableTriggers
 a flag containing all the available triggers

Static Protected Attributes

static Vector3D intersection
 the Vector3D that holds the intersection coordinates
static Vector3D normal
 the Vector3D that holds the intersection coordinates

Detailed Description

A abstract class that defines a physical object acting on particles.

A Modifier is first defined by a Zone and a trigger to that Zone.
If the Particle triggers the Modifier, the Modifier's action is applied to the Particle.
An action can be anything that has effect on the Particle's parameters, position, velocity, life...

If no Zone is attached to a Modifier the Zone is considered to be the entire universe.

Like an Emitter, a Modifier can either be used automatically within a Group or manually directly by the user.

Definition at line 64 of file SPK_Modifier.h.


Constructor & Destructor Documentation

Modifier ( int  availableTriggers = ALWAYS,
ModifierTrigger  trigger = ALWAYS,
bool  needsIntersection = false,
bool  needsNormal = false,
Zone zone = NULL 
)

Constructor of Modifier.

Parameters:
availableTriggers : the available triggers for this Modifier (OR-ed)
trigger : the default trigger of the Modifier
needsIntersection : true if the computation of the intersection is needed, false otherwise
needsNormal : true if the computation of the normal is needed, false otherwise
zone : the Zone of the Modifier
virtual ~Modifier (  )  [virtual]

Destructor of Modifier.

Definition at line 93 of file SPK_Modifier.h.


Member Function Documentation

virtual void destroyChildren ( bool  keepChildren  )  [protected, virtual]

Destroys the children of this Registerable.

This method has to be implemented in derived classes of Registerable which hold pointers or references of Registerable children.
The destroyChild(Registerable*,bool) has to be called within it for each child to destroy.
The keepChildren parameter of destroyChild is simply the keepChildren parameter of destroyChildren.

Parameters:
keepChildren : true to keep the children (used when destroying all registered Registerable)

Reimplemented from Registerable.

Reimplemented in ModifierGroup.

virtual Registerable* findByName ( const std::string &  name  )  [virtual]

Finds a registerable with its name recursively from this registerable.

If the name is not found, NULL is returned.
If the several objects with the same name exists, only the first one is returned.

Note that the name of the registerable itself is already tested.

Parameters:
name : the name of the registerable to find
Returns:
: the first registerable with that name within this registerable or NULL if none is found
Since:
1.05.00

Reimplemented from Registerable.

Reimplemented in ModifierGroup.

int getAvailableTriggers (  )  const

Gets a flag containing all the available triggers for this Modifier.

Returns:
a flag containing all the available triggers for this Modifier

Definition at line 288 of file SPK_Modifier.h.

ModifierTrigger getTrigger (  )  const

Gets the trigger of this Modifier.

Returns:
the trigger of this Modifier

Definition at line 283 of file SPK_Modifier.h.

Zone * getZone (  )  const

Gets the Zone of this Modifier.

Returns:
the Zone of this Modifier

Definition at line 278 of file SPK_Modifier.h.

bool isActive (  )  const

Tells whether this Modifier is active or not.

Returns:
true if this Modifier is active, false if is is inactive
Since:
1.03.00

Definition at line 273 of file SPK_Modifier.h.

bool isFullZone (  )  const

Tells whether the Zone of this Modifier is considerered to be full or not.

Returns:
true if the Zone of this Modifier is considerered to be full, false if not

Definition at line 293 of file SPK_Modifier.h.

bool isLocalToSystem (  )  const

Tells whether this modifier is considered as being local to a system or not.

A local modifier is transformed when its system is transformed, a non local one will not.

Returns:
true if it is local, false if not
Since:
1.03.02

Definition at line 298 of file SPK_Modifier.h.

void propagateUpdateTransform (  )  [protected, virtual]

Propagates the update of the transform to transformable children of this transformable.

This method can be overriden in derived classes of Transformable (By default it does nothing).
It is this method task to call the updateTransform method of transformable children of this transformable.

Since:
1.05.00

Reimplemented from Transformable.

Definition at line 303 of file SPK_Modifier.h.

virtual void registerChildren ( bool  registerAll  )  [protected, virtual]

Registers the children of this Registerable.

This method has to be implemented in derived classes of Registerable which hold pointers or references of Registerable children.
The registerChild(Registerable*,bool) has to be called within it for each child to copy from object.
The registerAll parameter of registerChild is simply the registerAll parameter of registerChildren.

Parameters:
registerAll : true to register unregistered children, false to only increment ref counts of already registered children
Since:
1.04.00

Reimplemented from Registerable.

Reimplemented in ModifierGroup.

void setActive ( bool  active  ) 

Sets this Modifier active or not.

An inactive Modifier will not affect its parent Group during update.
However it can still be used manually by the user.

Parameters:
active : true to activate this Modifier, false to deactivate it
Since:
1.03.00

Definition at line 263 of file SPK_Modifier.h.

void setLocalToSystem ( bool  local  ) 

Sets whether to consider this modifier local to a system or not.

A local modifier is transformed when its system is transformed, a non local one will not.

Parameters:
local : true to consider the modifier local, false not to
Since:
1.03.02

Definition at line 268 of file SPK_Modifier.h.

bool setTrigger ( ModifierTrigger  trigger  ) 

Sets the trigger of this Modifier.

if the trigger is not one of the available triggers (see getAvailableTriggers()) for this Modifier, nothing happens ad false is returned else the trigger is set and true is returned.

Parameters:
trigger : the trigger of this Modifier
Returns:
true if the trigger can be set, false otherwise
void setZone ( Zone zone,
bool  full = false 
)

Sets the Zone of this Modifier.

If the Zone is NULL, the Zone is considered to be the entire universe.

Parameters:
zone : the Zone of this Modifier
full : true to consider the Zone as a full object so that particles are not allowed to be within

Member Data Documentation

const int availableTriggers [protected]

a flag containing all the available triggers

Definition at line 210 of file SPK_Modifier.h.

Vector3D intersection [static, protected]

the Vector3D that holds the intersection coordinates

Definition at line 195 of file SPK_Modifier.h.

bool needsIntersection [protected]

true if the Modifier needs the intersection computation, false if not

Definition at line 201 of file SPK_Modifier.h.

bool needsNormal [protected]

true if the Modifier needs the normal computation, false if not

Definition at line 204 of file SPK_Modifier.h.

Vector3D normal [static, protected]

the Vector3D that holds the intersection coordinates

Definition at line 198 of file SPK_Modifier.h.

ModifierTrigger trigger [protected]

the current trigger of this Modifier

Definition at line 207 of file SPK_Modifier.h.


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