Particle Universe
1.2
|
#include <ParticleUniverseBaseCollider.h>
Public Types | |
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 | |
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) |
virtual void | copyAttributesTo (ParticleAffector *affector) |
Public Member Functions inherited from ParticleUniverse::ParticleAffector | |
ParticleAffector (void) | |
virtual | ~ParticleAffector (void) |
const AffectSpecialisation & | getAffectSpecialisation (void) const |
void | setAffectSpecialisation (const AffectSpecialisation &affectSpecialisation) |
const String & | getAffectorType (void) const |
void | setAffectorType (const String &affectorType) |
const String & | getName (void) const |
void | setName (const String &name) |
ParticleTechnique * | getParentTechnique (void) const |
void | setParentTechnique (ParticleTechnique *parentTechnique) |
virtual void | _prepare (ParticleTechnique *particleTechnique) |
virtual void | _unprepare (ParticleTechnique *particleTechnique) |
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) |
virtual void | _affect (ParticleTechnique *particleTechnique, Particle *particle, Real timeElapsed)=0 |
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 Vector3 & | getDerivedPosition (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) |
ParticleBehaviour * | getBehaviour (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 String & | getAliasName (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_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 Attributes | |
Real | mFriction |
Real | mBouncyness |
IntersectionType | mIntersectionType |
CollisionType | mCollisionType |
Real | mVelocityScale |
Protected Attributes inherited from ParticleUniverse::ParticleAffector | |
ParticleTechnique * | mParentTechnique |
String | mAffectorType |
String | mName |
AffectSpecialisation | mAffectSpecialisation |
list< String > | mExcludedEmitters |
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 | |
ParticleEmitter * | parentEmitter |
Vector3 | position |
Vector3 | direction |
Real | mass |
Real | timeToLive |
Real | totalTimeToLive |
Real | timeFraction |
ParticleType | particleType |
Any | mUserDefinedObject |
PhysicsActor * | physicsActor |
IVisualData * | visualData |
Vector3 | originalPosition |
Vector3 | originalDirection |
Real | originalVelocity |
Real | originalDirectionLength |
Real | originalScaledDirectionLength |
Vector3 | latestPosition |
The BaseCollider is the abstract class for Particle Colliders. A collider is a shape that can collide with a particle. In fact, particles can also be considered colliders, which allows particle-particle collision.
Determines how a particle behaves after collision with this collider. The behaviour of the particle is solved in the collider and only behaviour that needs the colliders´ data is taken into account. The fact that a particle expires for example, can be achieved by using an Observer in combination with an EventHandler (DoExpireEventHandler). CT_NONE means that the particle doesn´t do anything. This value should be set if the behaviour of the particle is determined outside the collider (for example, expiring the particle). CT_BOUNCE means that the particle bounces off the collider. CT_FLOW means that the particle flows around the contours of the collider.
Enumerator | |
---|---|
CT_NONE | |
CT_BOUNCE | |
CT_FLOW |
ParticleUniverse::BaseCollider::BaseCollider | ( | void | ) |
|
inlinevirtual |
|
virtual |
Perform activities before the individual particles are processed.
Reimplemented from ParticleUniverse::ParticleAffector.
Reimplemented in ParticleUniverse::BoxCollider, ParticleUniverse::SphereCollider, ParticleUniverse::BoxColliderExtern, and ParticleUniverse::SphereColliderExtern.
void ParticleUniverse::BaseCollider::calculateRotationSpeedAfterCollision | ( | Particle * | particle | ) |
Recalculates the rotation speed after collision. This function must be explicitly called in the _affect() function of the class that inherits from BaseCollider.
|
virtual |
Copy attributes to another affector.
Reimplemented from ParticleUniverse::ParticleAffector.
Reimplemented in ParticleUniverse::BoxCollider, ParticleUniverse::InterParticleCollider, ParticleUniverse::SphereCollider, and ParticleUniverse::PlaneCollider.
const Real ParticleUniverse::BaseCollider::getBouncyness | ( | void | ) | const |
Returns the bouncyness value.
const CollisionType ParticleUniverse::BaseCollider::getCollisionType | ( | void | ) | const |
Returns the type of collision.
const Real ParticleUniverse::BaseCollider::getFriction | ( | void | ) | const |
Returns the friction value.
const IntersectionType ParticleUniverse::BaseCollider::getIntersectionType | ( | void | ) | const |
Returns the type of intersection.
void ParticleUniverse::BaseCollider::populateAlignedBox | ( | AxisAlignedBox & | box, |
const Vector3 & | position, | ||
const Real | width, | ||
const Real | height, | ||
const Real | depth | ||
) |
Fill the AxisAlignedBox with data derived from the other arguments.
void ParticleUniverse::BaseCollider::setBouncyness | ( | const Real | bouncyness | ) |
Sets the bouncyness value.
void ParticleUniverse::BaseCollider::setCollisionType | ( | const CollisionType & | collisionType | ) |
Sets the type of collision.
void ParticleUniverse::BaseCollider::setFriction | ( | const Real | friction | ) |
Sets the friction value.
void ParticleUniverse::BaseCollider::setIntersectionType | ( | const IntersectionType & | intersectionType | ) |
Sets the type of intersection.
|
static |
|
static |
|
static |
|
static |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |