CrystalSpace

Public API Reference

iParticleBuiltinEffectorPhysical Struct Reference
[Mesh plugins]

Physical forces and collisions applied to particles. More...

#include <imesh/particles.h>

Inheritance diagram for iParticleBuiltinEffectorPhysical:

List of all members.

Public Member Functions

virtual csVector2 GetRestitution () const =0
 Get the coefficient of restitution.
virtual float GetRestitutionMagnitude () const =0
 Get the total magnitude of restitution.
virtual void SetRestitution (const csVector2 &rest)=0
 Set the normal (x) and tangential (y) coefficient of restitution which determines the "bounciness" of particles when colliding with other objects.
virtual void SetRestitutionMagnitude (float rest)=0
 Set the total magnitude of the coefficient of restitution.

Detailed Description

Physical forces and collisions applied to particles.

Particles will not penetrate other physical objects and will bounce upon contact (although they might still penetrate fast moving objects).

The new velocity of particles is computed by a simple formula:

v' = v + (a+g+f/m)*dt

v - old velocity (vector) v' - new velocity (vector) a - constant acceleration (vector) g - gravity of the collision sector (vector) f - force (vector) m - particle mass (scalar)

Upon collision, the particle is bounced against the surface being hit.

Definition at line 747 of file particles.h.


Member Function Documentation

virtual csVector2 iParticleBuiltinEffectorPhysical::GetRestitution (  )  const [pure virtual]

Get the coefficient of restitution.

virtual float iParticleBuiltinEffectorPhysical::GetRestitutionMagnitude (  )  const [pure virtual]

Get the total magnitude of restitution.

virtual void iParticleBuiltinEffectorPhysical::SetRestitution ( const csVector2 rest  )  [pure virtual]

Set the normal (x) and tangential (y) coefficient of restitution which determines the "bounciness" of particles when colliding with other objects.

The magnitude should be between 0 (no bounce) and 1 (speed after impact = speed before impact). A magnitude > 1 adds energy into the system upon every bounce, because particles will be faster after than before the impact.

virtual void iParticleBuiltinEffectorPhysical::SetRestitutionMagnitude ( float  rest  )  [pure virtual]

Set the total magnitude of the coefficient of restitution.

Assumes that tangential and normal components are equal. The magnitude should be between 0 (no bounce) and 1 (speed after impact = speed before impact). A magnitude > 1 adds energy into the system upon every bounce, because the particle will be faster after than before the impact.


The documentation for this struct was generated from the following file:

Generated for Crystal Space 2.1 by doxygen 1.6.1