A abstract class that defines a physical object acting on particles. More...
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. | |
Zone * | getZone () 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 Registerable * | findByName (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 |
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.
Modifier | ( | int | availableTriggers = ALWAYS , |
|
ModifierTrigger | trigger = ALWAYS , |
|||
bool | needsIntersection = false , |
|||
bool | needsNormal = false , |
|||
Zone * | zone = NULL | |||
) |
Constructor of Modifier.
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.
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.
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.
name | : the name of the registerable to find |
Reimplemented from Registerable.
Reimplemented in ModifierGroup.
int getAvailableTriggers | ( | ) | const |
Gets 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.
Definition at line 283 of file SPK_Modifier.h.
Zone * getZone | ( | ) | const |
bool isActive | ( | ) | const |
Tells whether this Modifier is active or not.
Definition at line 273 of file SPK_Modifier.h.
bool isFullZone | ( | ) | const |
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.
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.
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.
registerAll | : true to register unregistered children, false to only increment ref counts of already registered children |
Reimplemented from Registerable.
Reimplemented in ModifierGroup.
void setActive | ( | bool | active | ) |
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.
local | : true to consider the modifier local, false not to |
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.
trigger | : the trigger of this Modifier |
void setZone | ( | Zone * | zone, | |
bool | full = false | |||
) |
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.
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.