Particle Universe
1.2
|
#include <ParticleUniverseSystem.h>
Static Public Attributes | |
static const bool | DEFAULT_KEEP_LOCAL |
static const Real | DEFAULT_ITERATION_INTERVAL |
static const Real | DEFAULT_FIXED_TIMEOUT |
static const Real | DEFAULT_NON_VISIBLE_UPDATE_TIMEOUT |
static const bool | DEFAULT_SMOOTH_LOD |
static const Real | DEFAULT_FAST_FORWARD_TIME |
static const char * | DEFAULT_MAIN_CAMERA_NAME |
static const Real | DEFAULT_SCALE_VELOCITY |
static const Real | DEFAULT_SCALE_TIME |
static const Vector3 | DEFAULT_SCALE |
static const bool | DEFAULT_TIGHT_BOUNDINGBOX |
Static Public Attributes inherited from ParticleUniverse::Particle | |
static Real | DEFAULT_TTL |
static Real | DEFAULT_MASS |
Protected Member Functions | |
unsigned short | _getLodIndex (Real distance) const |
unsigned short | _getLodIndexSquaredDistance (Real squaredDistance) const |
void | calulateRotationOffset (void) |
void | _pushSystemEvent (EventType eventType) |
A ParticleSystem is the most top level of a particle structure, that consists of Particles, ParticleEmitters, ParticleAffectors, ParticleObservers, etc.
typedef LodDistanceList::const_iterator ParticleUniverse::ParticleSystem::LodDistanceConstIterator |
typedef LodDistanceList::iterator ParticleUniverse::ParticleSystem::LodDistanceIterator |
Distance list used to specify LOD
typedef vector<ParticleSystemListener*>::iterator ParticleUniverse::ParticleSystem::ParticleSystemListenerIterator |
typedef vector<ParticleSystemListener*> ParticleUniverse::ParticleSystem::ParticleSystemListenerList |
typedef ParticleTechniqueList::const_iterator ParticleUniverse::ParticleSystem::ParticleTechniqueConstIterator |
typedef ParticleTechniqueList::iterator ParticleUniverse::ParticleSystem::ParticleTechniqueIterator |
ParticleUniverse::ParticleSystem::ParticleSystem | ( | const String & | name | ) |
ParticleUniverse::ParticleSystem::ParticleSystem | ( | const String & | name, |
const String & | resourceGroupName | ||
) |
|
virtual |
|
protected |
Gets the LOD index to use at the given distance.
|
protected |
Gets the LOD index to use at the given squared distance.
|
virtual |
Perform initialising activities as soon as the particle is emitted.
Reimplemented from ParticleUniverse::Particle.
|
virtual |
Perform some action if the particle expires.
Reimplemented from ParticleUniverse::Particle.
void ParticleUniverse::ParticleSystem::_markForEmission | ( | void | ) |
Mark all emitted objects (ParticleTechniques and all the objects registered at each ParticleTechnique).
|
virtual |
|
inlinevirtual |
void ParticleUniverse::ParticleSystem::_notifyEmissionChange | ( | void | ) |
Is called as soon as a new technique is added or deleted, which leads to a re-evaluation of the emitted objects.
void ParticleUniverse::ParticleSystem::_notifyRescaled | ( | void | ) |
Notify registered ParticleTechniques.
void ParticleUniverse::ParticleSystem::_notifyVelocityRescaled | ( | void | ) |
Notify registered ParticleTechniques.
|
virtual |
Perform actions on the particle itself during the update loop of a ParticleTechnique.
Reimplemented from ParticleUniverse::Particle.
|
protected |
Convenient function to generate events.
void ParticleUniverse::ParticleSystem::_resetBounds | ( | void | ) |
Reset the bounding box of the particle system to the most minimal value.
void ParticleUniverse::ParticleSystem::_resetMarkForEmission | ( | void | ) |
Reset mark for emission indication for all techniques.
void ParticleUniverse::ParticleSystem::_update | ( | Real | timeElapsed | ) |
Updates the particle system based on time elapsed.
timeElapsed | The amount of time, in seconds, since the last frame. |
|
inlinevirtual |
size_t ParticleUniverse::ParticleSystem::_updateTechniques | ( | Real | timeElapsed | ) |
Update all techniques and return the number of emitted particles for any function who is interested.
timeElapsed | The amount of time, in seconds, since the last frame. |
void ParticleUniverse::ParticleSystem::addLodDistance | ( | Real | distance | ) |
Adds a distance at which level-of-detail (LOD) levels come into effect.
void ParticleUniverse::ParticleSystem::addParticleSystemListener | ( | ParticleSystemListener * | particleSystemListener | ) |
Add a ParticleSystemListener, which gets called as soon as a ParticleSystem is started or stopped.
void ParticleUniverse::ParticleSystem::addTechnique | ( | ParticleTechnique * | technique | ) |
Add a technique to the list.
technique | Pointer to a previously created technique. |
|
inlineprotected |
Calculate rotation of the node.
void ParticleUniverse::ParticleSystem::clearLodDistances | ( | void | ) |
Clears the list with distances.
ParticleTechnique* ParticleUniverse::ParticleSystem::createTechnique | ( | void | ) |
Create a ParticleTechnique and add it to this ParticleSystem.
void ParticleUniverse::ParticleSystem::destroyAllTechniques | ( | void | ) |
Destroy all ParticleTechniques of this ParticleSystem.
void ParticleUniverse::ParticleSystem::destroyTechnique | ( | ParticleTechnique * | particleTechnique | ) |
Destroy a ParticleTechnique.
void ParticleUniverse::ParticleSystem::destroyTechnique | ( | size_t | index | ) |
Destroy a ParticleTechnique identified by means of an index.
void ParticleUniverse::ParticleSystem::fastForward | ( | void | ) |
|
virtual |
|
virtual |
|
inline |
Get/set a category. See 'mCategory' for a description of its use.
Camera* ParticleUniverse::ParticleSystem::getCurrentCamera | ( | void | ) |
Returns a pointer to the current camera (the one that gets updated/notified).
|
virtual |
Gets the derived orientation of the particle system (i.e derived from the parent node, if available).
|
virtual |
Gets the derived position of the particle system (i.e derived from the parent node, if available).
const Real ParticleUniverse::ParticleSystem::getFastForwardInterval | ( | void | ) | const |
const Real ParticleUniverse::ParticleSystem::getFastForwardTime | ( | void | ) | const |
const Real ParticleUniverse::ParticleSystem::getFixedTimeout | ( | void | ) | const |
const Real ParticleUniverse::ParticleSystem::getIterationInterval | ( | void | ) | const |
const Quaternion& ParticleUniverse::ParticleSystem::getLatestOrientation | ( | void | ) | const |
Gets the latest orientation of the particle system before update.
const LodDistanceList& ParticleUniverse::ParticleSystem::getLodDistances | ( | void | ) | const |
Returns the distances at which level-of-detail (LOD) levels come into effect.
Camera* ParticleUniverse::ParticleSystem::getMainCamera | ( | void | ) |
const String& ParticleUniverse::ParticleSystem::getMainCameraName | ( | void | ) | const |
Get the main camera (name).
|
virtual |
const Real ParticleUniverse::ParticleSystem::getNonVisibleUpdateTimeout | ( | void | ) | const |
|
inline |
Return number of all emitted particles
|
inline |
Return number of emitted particles of a certain type
size_t ParticleUniverse::ParticleSystem::getNumEmittedTechniques | ( | void | ) | const |
Returns the number of emitted ParticleTechniques.
size_t ParticleUniverse::ParticleSystem::getNumTechniques | ( | void | ) | const |
Get the number of ParticleTechniques of this ParticleSystem.
Real ParticleUniverse::ParticleSystem::getPauseTime | ( | void | ) | const |
Returns the time of a pause (if set)
|
inline |
Get the name of the resource group that is assigned to this ParticleSystem.
const Vector3& ParticleUniverse::ParticleSystem::getScale | ( | void | ) | const |
Returns the scale.
const Real& ParticleUniverse::ParticleSystem::getScaleTime | ( | void | ) | const |
Get the time scale.
const Real& ParticleUniverse::ParticleSystem::getScaleVelocity | ( | void | ) | const |
Returns the velocity scale.
Ogre::SceneManager* ParticleUniverse::ParticleSystem::getSceneManager | ( | void | ) |
Get the SceneManager with which the ParticleSystem is created
|
inline |
Returns the state of the particle system.
ParticleTechnique* ParticleUniverse::ParticleSystem::getTechnique | ( | size_t | index | ) | const |
Get a ParticleTechnique given a certain index.
ParticleTechnique* ParticleUniverse::ParticleSystem::getTechnique | ( | const String & | name | ) | const |
Get a ParticleTechnique. Search by ParticleTechnique name.
const String& ParticleUniverse::ParticleSystem::getTemplateName | ( | void | ) | const |
Returns the name of the template which acted as a blueprint for creation of this Particle System.
|
inline |
Returns the time since the ParticleSystem was started.
bool ParticleUniverse::ParticleSystem::hasExternType | ( | const String & | externType | ) | const |
Returns 'true' if one of externs is of a certain type.
bool ParticleUniverse::ParticleSystem::hasMainCamera | ( | void | ) |
True if the main camera has been set.
bool ParticleUniverse::ParticleSystem::hasRotatedBetweenUpdates | ( | void | ) | const |
Returns true if the particle system has rotated between updates.
bool ParticleUniverse::ParticleSystem::hasTightBoundingBox | ( | void | ) | const |
Is 'true' when the bounding box is wrapped tight around the particle system or 'false' when the bounding box is only increasing and doesn´t shrink when the particle system shrinks.
bool ParticleUniverse::ParticleSystem::isKeepLocal | ( | void | ) | const |
|
inline |
Determines whether the parent is a TagPoint or a SceneNode.
|
inline |
Is smooth Lod set?.
bool ParticleUniverse::ParticleSystem::isStopFade | ( | void | ) |
if stopFade is set, then this will return true.
bool ParticleUniverse::ParticleSystem::makeParticleLocal | ( | Particle * | particle | ) |
Transforms the particle position in a local position relative to the system
ParticleSystem& ParticleUniverse::ParticleSystem::operator= | ( | const ParticleSystem & | ps | ) |
Assignment operator.
void ParticleUniverse::ParticleSystem::pause | ( | void | ) |
Pauses the particle system.
void ParticleUniverse::ParticleSystem::pause | ( | Real | pauseTime | ) |
Pauses the particle system for a period of time. After this time, the Particle System automatically resumes.
void ParticleUniverse::ParticleSystem::prepare | ( | void | ) |
Prepares the particle system.
void ParticleUniverse::ParticleSystem::pushEvent | ( | ParticleUniverseEvent & | particleUniverseEvent | ) |
This function is called as soon as an event withing the Particle System occurs.
void ParticleUniverse::ParticleSystem::removeParticleSystemListener | ( | ParticleSystemListener * | particleSystemListener | ) |
Removes the ParticleSystemListener, but it the ParticleSystemListener isn't destroyed.
void ParticleUniverse::ParticleSystem::removeTechnique | ( | ParticleTechnique * | technique | ) |
Remove a technique from the system, but don't destroy it.
void ParticleUniverse::ParticleSystem::resume | ( | void | ) |
Resumes the particle system.
void ParticleUniverse::ParticleSystem::rotationOffset | ( | Vector3 & | pos | ) |
If the orientation of the particle system has been changed since the last update, the passed vector is rotated accordingly.
void ParticleUniverse::ParticleSystem::setBoundsAutoUpdated | ( | bool | autoUpdate, |
Real | stopIn = 0.0f |
||
) |
Sets whether the bounds will be automatically updated for the life of the particle system.
|
inline |
|
virtual |
Reimplemented from ParticleUniverse::Particle.
void ParticleUniverse::ParticleSystem::setFixedTimeout | ( | const Real | fixedTimeout | ) |
void ParticleUniverse::ParticleSystem::setIterationInterval | ( | const Real | iterationInterval | ) |
void ParticleUniverse::ParticleSystem::setKeepLocal | ( | bool | keepLocal | ) |
If this attribute is set to 'true', the particles are emitted relative to the system
void ParticleUniverse::ParticleSystem::setLodDistances | ( | const LodDistanceList & | lodDistances | ) |
Sets the distance at which level-of-detail (LOD) levels come into effect.
lodDistances | A vector of Reals which indicate the distance at which to switch to another ParticleTechnique. |
void ParticleUniverse::ParticleSystem::setMainCamera | ( | Camera * | camera | ) |
void ParticleUniverse::ParticleSystem::setMainCameraName | ( | String | cameraName | ) |
Set the main camera (name).
void ParticleUniverse::ParticleSystem::setNonVisibleUpdateTimeout | ( | Real | timeout | ) |
void ParticleUniverse::ParticleSystem::setPauseTime | ( | Real | pauseTime | ) |
Set the pause time. This is used to pause the ParticleSystem for a certain amount of time.
|
virtual |
|
inline |
Set the name of the resource group for this ParticleSystem.
void ParticleUniverse::ParticleSystem::setScale | ( | const Vector3 & | scale | ) |
Set the scale independant from the node to which it is attached.
void ParticleUniverse::ParticleSystem::setScaleTime | ( | const Real & | scaleTime | ) |
Set the time scale.
void ParticleUniverse::ParticleSystem::setScaleVelocity | ( | const Real & | scaleVelocity | ) |
Set the velocity scale.
void ParticleUniverse::ParticleSystem::setSceneManager | ( | Ogre::SceneManager * | sceneManager | ) |
Set the SceneManager with which the ParticleSystem is created
|
inline |
Set smooth Lod.
void ParticleUniverse::ParticleSystem::setTemplateName | ( | const String & | templateName | ) |
Set the name of the template which acts as a blueprint for creation of this Particle System.
void ParticleUniverse::ParticleSystem::setTightBoundingBox | ( | bool | tightBoundingBox | ) |
Set mTightBoundingBox.
void ParticleUniverse::ParticleSystem::setUseController | ( | bool | useController | ) |
Set the indication to false if you want to update the particle system yourself
void ParticleUniverse::ParticleSystem::start | ( | void | ) |
Starts the particle system.
void ParticleUniverse::ParticleSystem::start | ( | Real | stopTime | ) |
Starts the particle system and stops after a period of time.
void ParticleUniverse::ParticleSystem::startAndStopFade | ( | Real | stopTime | ) |
Convenient function to start and stop (gradually) in one step.
void ParticleUniverse::ParticleSystem::stop | ( | void | ) |
Stops the particle system.
void ParticleUniverse::ParticleSystem::stop | ( | Real | stopTime | ) |
Stops the particle system after a period of time.
void ParticleUniverse::ParticleSystem::stopFade | ( | void | ) |
Stops emission of all particle and really stops the particle system when all particles are expired.
void ParticleUniverse::ParticleSystem::stopFade | ( | Real | stopTime | ) |
Stops emission of all particle after a period of time and really stops the particle system when all particles are expired.
void ParticleUniverse::ParticleSystem::suppressNotifyEmissionChange | ( | bool | suppress | ) |
Function to suppress notification of an emission change.
|
inlinevirtual |
Implements Ogre::MovableObject.
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
protected |
|
protected |
Flag, used to determine whether a particle has been emitted.
|
protected |
|
protected |
Determines whether the recalculation of the bounding box is performed automatically.
|
protected |
Time that indicates how long the AABB must be calculated before it is fixed.
|
protected |
Used to define to which category the particle system belongs. This is pure for administration and can be used in an editor. There is no technical reason to set this attribute.
|
protected |
|
protected |
|
protected |
Fastforward settings
|
protected |
|
protected |
If set, the ParticleSystem automatically stops after ´mFixedTimeout´ seconds.
|
protected |
Indication to determine whether mFixedTimeout has been set.
|
protected |
Value that determines in which intervals the system must be the updated.
|
protected |
Indication to determine whether updating of the technique must be done in predefined intervals.
|
protected |
Determines whether particle positions should be kept local in relation to the system.
|
protected |
Used to determine whether a LOD transition occured.
|
protected |
Last frame in which known to be visible
|
protected |
To keep track of rotation between updates, the latest rotation must be kept.
|
protected |
List with LOD (= Level Of Detail) distances.
|
protected |
If the mainCameraName has been set, the number of updates for other cameras is limited.
|
protected |
|
protected |
Update timeout when nonvisible (0 for no timeout)
|
protected |
Update timeout when nonvisible set?
|
protected |
Original value of mBoundsUpdateTime.
|
protected |
|
protected |
List of ParticleSystemListeners
|
protected |
|
protected |
Scale time.
|
protected |
Scale velocity.
|
protected |
The Particle System can be paused for a specific time
|
protected |
|
protected |
|
protected |
Name of the resource group that is assigned to this ParticleSystem.
|
protected |
The rotation centre.
|
protected |
Rotation offset between 2 updates.
|
protected |
The SceneManager with which the Particle System is created.
|
protected |
Determines whether Lodding is performed instantly of smoothly.
|
protected |
State of the particle system.
|
protected |
The stopFade() function is called if set to true.
|
protected |
Indication whether _notifyEmissionChange() must be suppressed or not.
|
protected |
|
protected |
The name of the template on which this Particle System is derived.
|
protected |
Determines whether the bounding box is tight around the particle system or whether the bounding is growing and never shrinks.
|
protected |
Controller for time update
|
protected |
Counts the time since the ParticleSystem was started.
|
protected |
Attribute used to calculate the time since the last update.
|
protected |
Amount of time non-visible so far
|
protected |
Set the mUseController to false if you want to call the _update() function yourself.