Particle Universe  1.2
ParticleUniverse::InterParticleCollider Class Reference

#include <ParticleUniverseInterParticleCollider.h>

Inheritance diagram for ParticleUniverse::InterParticleCollider:

Public Types

enum  InterParticleCollisionResponse { IPCR_AVERAGE_VELOCITY, IPCR_ANGLE_BASED_VELOCITY }
 
- Public Types inherited from ParticleUniverse::BaseCollider
enum  IntersectionType { IT_POINT, IT_BOX }
 
enum  CollisionType { CT_NONE, CT_BOUNCE, CT_FLOW }
 
- Public Types inherited from ParticleUniverse::ParticleAffector
enum  AffectSpecialisation { AFSP_DEFAULT, AFSP_TTL_INCREASE, AFSP_TTL_DECREASE }
 
- Public Types inherited from ParticleUniverse::Particle
enum  ParticleType {
  PT_VISUAL, PT_TECHNIQUE, PT_EMITTER, PT_AFFECTOR,
  PT_SYSTEM
}
 
enum  ReservedParticleEventFlags { PEF_EXPIRED = 1<<0, PEF_EMITTED = 1<<1, PEF_COLLIDED = 1<<2 }
 
typedef vector< ParticleBehaviour * > ParticleBehaviourList
 
typedef ParticleBehaviourList::const_iterator ParticleBehaviourIterator
 
- Public Types inherited from ParticleUniverse::IAlias
enum  AliasType {
  AT_UNDEFINED, AT_TECHNIQUE, AT_RENDERER, AT_EMITTER,
  AT_AFFECTOR, AT_OBSERVER, AT_EXTERN, AT_HANDLER,
  AT_BEHAVIOUR
}
 

Public Member Functions

 InterParticleCollider (void)
 
virtual ~InterParticleCollider (void)
 
Real getAdjustment (void) const
 
void setAdjustment (Real adjustment)
 
InterParticleCollisionResponse getInterParticleCollisionResponse (void) const
 
void setInterParticleCollisionResponse (InterParticleCollisionResponse interParticleCollisionResponse)
 
virtual void _prepare (ParticleTechnique *particleTechnique)
 
virtual void _unprepare (ParticleTechnique *particleTechnique)
 
virtual void _affect (ParticleTechnique *particleTechnique, Particle *particle, Real timeElapsed)
 
virtual void copyAttributesTo (ParticleAffector *affector)
 
- Public Member Functions inherited from ParticleUniverse::BaseCollider
 BaseCollider (void)
 
virtual ~BaseCollider (void)
 
virtual void _preProcessParticles (ParticleTechnique *particleTechnique, Real timeElapsed)
 
const IntersectionType getIntersectionType (void) const
 
void setIntersectionType (const IntersectionType &intersectionType)
 
const CollisionType getCollisionType (void) const
 
void setCollisionType (const CollisionType &collisionType)
 
const Real getFriction (void) const
 
void setFriction (const Real friction)
 
const Real getBouncyness (void) const
 
void setBouncyness (const Real bouncyness)
 
void populateAlignedBox (AxisAlignedBox &box, const Vector3 &position, const Real width, const Real height, const Real depth)
 
void calculateRotationSpeedAfterCollision (Particle *particle)
 
- Public Member Functions inherited from ParticleUniverse::ParticleAffector
 ParticleAffector (void)
 
virtual ~ParticleAffector (void)
 
const AffectSpecialisationgetAffectSpecialisation (void) const
 
void setAffectSpecialisation (const AffectSpecialisation &affectSpecialisation)
 
const StringgetAffectorType (void) const
 
void setAffectorType (const String &affectorType)
 
const StringgetName (void) const
 
void setName (const String &name)
 
ParticleTechniquegetParentTechnique (void) const
 
void setParentTechnique (ParticleTechnique *parentTechnique)
 
virtual void _notifyStart (void)
 
virtual void _notifyStop (void)
 
virtual void _notifyPause (void)
 
virtual void _notifyResume (void)
 
virtual void _notifyRescaled (const Vector3 &scale)
 
virtual void _firstParticle (ParticleTechnique *particleTechnique, Particle *particle, Real timeElapsed)
 
virtual void _initForEmission (void)
 
virtual void _initForExpiration (ParticleTechnique *technique, Real timeElapsed)
 
virtual void _initParticleForEmission (Particle *particle)
 
void _processParticle (ParticleTechnique *particleTechnique, Particle *particle, Real timeElapsed, bool firstParticle)
 
virtual void _postProcessParticles (ParticleTechnique *technique, Real timeElapsed)
 
void addEmitterToExclude (const String &emitterName)
 
void removeEmitterToExclude (const String &emitterName)
 
void removeAllEmittersToExclude (void)
 
const list< String > & getEmittersToExclude (void) const
 
bool hasEmitterToExclude (const String &emitterName)
 
virtual void copyParentAttributesTo (ParticleAffector *affector)
 
const Vector3getDerivedPosition (void)
 
Real _calculateAffectSpecialisationFactor (const Particle *particle)
 
- Public Member Functions inherited from ParticleUniverse::Particle
 Particle (void)
 
virtual ~Particle (void)
 
bool _isMarkedForEmission (void) const
 
void _setMarkedForEmission (bool markedForEmission)
 
virtual bool isEnabled (void) const
 
virtual void setEnabled (bool enabled)
 
void _setOriginalEnabled (bool originalEnabled)
 
bool _getOriginalEnabled (void) const
 
bool isFreezed (void) const
 
void setFreezed (bool freezed)
 
void setEventFlags (uint32 flags)
 
void addEventFlags (uint32 flags)
 
void removeEventFlags (uint32 flags)
 
uint32 getEventFlags (void) const
 
bool hasEventFlags (uint32 flags) const
 
void copyBehaviours (ParticleBehaviourList &behaviours)
 
virtual void _process (ParticleTechnique *technique, Real timeElapsed)
 
ParticleBehaviourgetBehaviour (const String &behaviourType)
 
Real calculateVelocity (void) const
 
virtual void copyAttributesTo (Particle *particle)
 
- Public Member Functions inherited from ParticleUniverse::IAlias
 IAlias (void)
 
virtual ~IAlias (void)
 
const StringgetAliasName (void) const
 
void setAliasName (String aliasName)
 
const AliasType getAliasType (void) const
 
void setAliasType (AliasType aliasType)
 
- Public Member Functions inherited from ParticleUniverse::IElement
 IElement (void)
 
virtual ~IElement (void)
 

Static Public Attributes

static const Real DEFAULT_ADJUSTMENT
 
static const InterParticleCollisionResponse DEFAULT_COLLISION_RESPONSE
 
- Static Public Attributes inherited from ParticleUniverse::BaseCollider
static const Real DEFAULT_BOUNCYNESS
 
static const Real DEFAULT_FRICTION
 
static const IntersectionType DEFAULT_INTERSECTION_TYPE
 
static const CollisionType DEFAULT_COLLISION_TYPE
 
- Static Public Attributes inherited from ParticleUniverse::ParticleAffector
static const bool DEFAULT_ENABLED
 
static const Vector3 DEFAULT_POSITION
 
static const AffectSpecialisation DEFAULT_SPECIALISATION
 
- Static Public Attributes inherited from ParticleUniverse::Particle
static Real DEFAULT_TTL
 
static Real DEFAULT_MASS
 

Protected Member Functions

bool _validateAndExecuteSphereCollision (Particle *particle1, Particle *particle2, Real timeElapsed)
 

Protected Attributes

Real mAdjustment
 
InterParticleCollisionResponse mInterParticleCollisionResponse
 
- Protected Attributes inherited from ParticleUniverse::BaseCollider
Real mFriction
 
Real mBouncyness
 
IntersectionType mIntersectionType
 
CollisionType mCollisionType
 
Real mVelocityScale
 
- Protected Attributes inherited from ParticleUniverse::ParticleAffector
ParticleTechniquemParentTechnique
 
String mAffectorType
 
String mName
 
AffectSpecialisation mAffectSpecialisation
 
list< StringmExcludedEmitters
 
Vector3 _mAffectorScale
 
- Protected Attributes inherited from ParticleUniverse::Particle
uint32 mEventFlags
 
bool mMarkedForEmission
 
bool mEnabled
 
bool mFreezed
 
bool mOriginalEnabled
 
bool mOriginalEnabledSet
 
Vector3 mDerivedPosition
 
ParticleBehaviourList mBehaviours
 
- Protected Attributes inherited from ParticleUniverse::IAlias
String mAliasName
 
AliasType mAliasType
 

Additional Inherited Members

- Public Attributes inherited from ParticleUniverse::Particle
ParticleEmitterparentEmitter
 
Vector3 position
 
Vector3 direction
 
Real mass
 
Real timeToLive
 
Real totalTimeToLive
 
Real timeFraction
 
ParticleType particleType
 
Any mUserDefinedObject
 
PhysicsActorphysicsActor
 
IVisualDatavisualData
 
Vector3 originalPosition
 
Vector3 originalDirection
 
Real originalVelocity
 
Real originalDirectionLength
 
Real originalScaledDirectionLength
 
Vector3 latestPosition
 

Detailed Description

The InterParticleCollider is used to perform particle-particle collision.

Member Enumeration Documentation

Enumerator
IPCR_AVERAGE_VELOCITY 
IPCR_ANGLE_BASED_VELOCITY 

Constructor & Destructor Documentation

ParticleUniverse::InterParticleCollider::InterParticleCollider ( void  )
virtual ParticleUniverse::InterParticleCollider::~InterParticleCollider ( void  )
inlinevirtual

Member Function Documentation

virtual void ParticleUniverse::InterParticleCollider::_affect ( ParticleTechnique particleTechnique,
Particle particle,
Real  timeElapsed 
)
virtual

Affect a particle.

Parameters
particlePointer to a ParticleTechnique to which the particle belongs.
particlePointer to a Particle.
timeElapsedThe number of seconds which have elapsed since the last call.

Implements ParticleUniverse::ParticleAffector.

virtual void ParticleUniverse::InterParticleCollider::_prepare ( ParticleTechnique particleTechnique)
virtual

Perform initialisation actions.

Remarks
The _prepare() function is automatically called during initialisation (prepare) activities of a ParticleTechnique. A subclass could implement this function to perform initialisation actions.

Reimplemented from ParticleUniverse::ParticleAffector.

virtual void ParticleUniverse::InterParticleCollider::_unprepare ( ParticleTechnique particleTechnique)
virtual

Reverse the actions from the _prepare.

Reimplemented from ParticleUniverse::ParticleAffector.

bool ParticleUniverse::InterParticleCollider::_validateAndExecuteSphereCollision ( Particle particle1,
Particle particle2,
Real  timeElapsed 
)
protected

Todo

virtual void ParticleUniverse::InterParticleCollider::copyAttributesTo ( ParticleAffector affector)
virtual

Copy attributes to another affector.

Reimplemented from ParticleUniverse::BaseCollider.

Real ParticleUniverse::InterParticleCollider::getAdjustment ( void  ) const

Todo

InterParticleCollisionResponse ParticleUniverse::InterParticleCollider::getInterParticleCollisionResponse ( void  ) const

Todo

void ParticleUniverse::InterParticleCollider::setAdjustment ( Real  adjustment)

Todo

void ParticleUniverse::InterParticleCollider::setInterParticleCollisionResponse ( InterParticleCollisionResponse  interParticleCollisionResponse)

Todo

Member Data Documentation

const Real ParticleUniverse::InterParticleCollider::DEFAULT_ADJUSTMENT
static
const InterParticleCollisionResponse ParticleUniverse::InterParticleCollider::DEFAULT_COLLISION_RESPONSE
static
Real ParticleUniverse::InterParticleCollider::mAdjustment
protected
InterParticleCollisionResponse ParticleUniverse::InterParticleCollider::mInterParticleCollisionResponse
protected

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