VoltAir
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Groups Pages
Signals | Public Member Functions | Protected Member Functions | Properties | List of all members
WaterBodyLogic Class Reference

Creates a body of water formed from WaterParticles. More...

Inheritance diagram for WaterBodyLogic:
ParticleEmitterLogic EmitterLogic Logic QObject

Signals

void spawnStrideChanged ()
 Emitted when spawnStride changes. More...
 
- Signals inherited from ParticleEmitterLogic
void colorChanged ()
 Emitted when color changes. More...
 
void pauseDistanceChanged ()
 Emitted when pauseDistance changes. More...
 
void layerChanged ()
 Emitted when layer changes. More...
 
- Signals inherited from EmitterLogic
void requestedMaxEntityCountChanged ()
 Emitted when requestedMaxEntityCount changes. More...
 
void spawnRateChanged ()
 Emitted when spawnRate changes. More...
 
void spawnVelocityChanged ()
 Emitted when spawnVelocity changes. More...
 
void spawnSpreadChanged ()
 Emitted when spawnSpread changes. More...
 
void spawnSprayChanged ()
 Emitted when spawnSpray changes. More...
 
void spawnRandomChanged ()
 Emitted when spawnRandom changes. More...
 
void timeOffChanged ()
 Emitted when timeOff changes. More...
 
void timeOnChanged ()
 Emitted when timeOn changes. More...
 
void transitionOnTimeChanged ()
 Emitted when transitionOnTime changes. More...
 
void transitionOffTimeChanged ()
 Emitted when transitionOffTime changes. More...
 
void decayTimeChanged ()
 Emitted when decayTime changes. More...
 
void decayTimeRandomLengthChanged ()
 Emitted when decayTimeRandomLength changes. More...
 
void pausedChanged ()
 Emitted when paused changes. More...
 
- Signals inherited from Logic
void activeChanged ()
 Emitted when active changes. More...
 

Public Member Functions

 WaterBodyLogic ()
 Constructs a WaterBodyLogic. More...
 
virtual int getSupportedMaxEntityCount () const override
 Returns the maximum number of particles that can be spawned by the class (i.e. the maximum number of particles that can fit in the actor's Body shape. More...
 
virtual void init () override
 Spawns initial particles to fill the body of water. More...
 
virtual void update () override
 Spawns particles to fill the WaterBody if necessary and decays particles outside of the actor's Body bounding box. More...
 
- Public Member Functions inherited from ParticleEmitterLogic
QColor getColor () const
 Returns color. More...
 
void setColor (const QColor &color)
 Sets color. More...
 
float getPauseDistance () const
 Returns pauseDistance. More...
 
void setPauseDistance (float value)
 Sets pauseDistance. More...
 
ParticleLayergetLayer () const
 Returns layer. More...
 
void setLayer (ParticleLayer *value)
 Sets layer. More...
 
virtual int getEntityCount () const override
 Returns entityCount. More...
 
- Public Member Functions inherited from EmitterLogic
int getRequestedMaxEntityCount () const
 Returns requestedMaxEntityCount. More...
 
void setRequestedMaxEntityCount (int value)
 Sets requestedMaxEntityCount. More...
 
int getMaxEntityCount () const
 Returns maxEntityCount. More...
 
float getSpawnRate () const
 Returns spawnRate. More...
 
void setSpawnRate (float value)
 Sets spawnRate. More...
 
float getSpawnVelocity () const
 Returns spawnVelocity. More...
 
void setSpawnVelocity (float value)
 Sets spawnVelocity. More...
 
float getSpawnSpread () const
 Returns spawnSpread. More...
 
void setSpawnSpread (float value)
 Sets spawnSpread. More...
 
float getSpawnSpray () const
 Returns spawnSpray. More...
 
void setSpawnSpray (float value)
 Sets spawnSpray. More...
 
bool isSpawnRandom () const
 Returns spawnRandom. More...
 
void setSpawnRandom (bool value)
 Sets spawnRandom. More...
 
float getTimeOn () const
 Returns timeOn. More...
 
void setTimeOn (float value)
 Sets timeOn. More...
 
float getTimeOff () const
 Returns timeOff. More...
 
void setTimeOff (float value)
 Sets timeOff. More...
 
float getTransitionOnTime () const
 Returns transitionOnTime. More...
 
void setTransitionOnTime (float value)
 Sets transitionOnTime. More...
 
float getTransitionOffTime () const
 Returns transitionOffTime. More...
 
void setTransitionOffTime (float value)
 Sets transitionOffTime. More...
 
float getDecayTime () const
 Returns decayTime. More...
 
void setDecayTime (float value)
 Sets decayTime. More...
 
float getDecayTimeRandomLength () const
 Returns decayTimeRandomLength. More...
 
void setDecayTimeRandomLength (float value)
 Sets decayTimeRandomLength. More...
 
bool isPaused () const
 Returns paused. More...
 
void setPaused (bool value)
 Sets paused. More...
 
- Public Member Functions inherited from Logic
 Logic (QObject *parent=nullptr)
 Constructs a Logic. More...
 
ActorgetActor () const
 Returns actor. More...
 
bool isActive () const
 Returns active. More...
 
void setActive (bool value)
 Sets active. More...
 
- Public Member Functions inherited from QObject
 QObject (QObject *parent)
 
virtual bool event (QEvent *e)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
virtual const QMetaObjectmetaObject () const
 
QString objectName () const
 
void setObjectName (const QString &name)
 
bool isWidgetType () const
 
bool isWindowType () const
 
bool signalsBlocked () const
 
bool blockSignals (bool block)
 
QThreadthread () const
 
void moveToThread (QThread *targetThread)
 
int startTimer (int interval, Qt::TimerType timerType)
 
void killTimer (int id)
 
findChild (const QString &name, QFlags< Qt::FindChildOption > options) const
 
QList< T > findChildren (const QString &name, QFlags< Qt::FindChildOption > options) const
 
QList< T > findChildren (const QRegExp &regExp, QFlags< Qt::FindChildOption > options) const
 
QList< T > findChildren (const QRegularExpression &re, QFlags< Qt::FindChildOption > options) const
 
const QObjectList & children () const
 
void setParent (QObject *parent)
 
void installEventFilter (QObject *filterObj)
 
void removeEventFilter (QObject *obj)
 
QMetaObject::Connection connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const
 
bool disconnect (const char *signal, const QObject *receiver, const char *method) const
 
bool disconnect (const QObject *receiver, const char *method) const
 
void dumpObjectTree ()
 
void dumpObjectInfo ()
 
bool setProperty (const char *name, const QVariant &value)
 
QVariant property (const char *name) const
 
QList< QByteArraydynamicPropertyNames () const
 
void destroyed (QObject *obj)
 
void objectNameChanged (const QString &objectName)
 
QObjectparent () const
 
bool inherits (const char *className) const
 
void deleteLater ()
 

Protected Member Functions

virtual void onPausedChanged () override
 Notifies WaterBodyLogic to respawn enough particles to fill actor's Body shape if the emitter has because unpaused. More...
 
virtual QRectF getEmitterWorldBounds () override
 Returns the bounding box of this emitter in world coordinates. More...
 
- Protected Member Functions inherited from ParticleEmitterLogic
WaterParticleSetgetWaterParticleSet ()
 Returns the backing WaterParticleSet. More...
 
virtual void emitEntity (const SpawnParameters &parameters) override
 Spawns a new WaterParticle into an internal WaterParticleSet. More...
 
- Protected Member Functions inherited from EmitterLogic
SpawnParameters getNextRandomSpawnParameters () const
 Returns a randomized set of SpawnParameters according to EmitterLogic's parameters. More...
 
- Protected Member Functions inherited from QObject
QObjectsender () const
 
int senderSignalIndex () const
 
int receivers (const char *signal) const
 
bool isSignalConnected (const QMetaMethod &signal) const
 
virtual void timerEvent (QTimerEvent *event)
 
virtual void childEvent (QChildEvent *event)
 
virtual void customEvent (QEvent *event)
 
virtual void connectNotify (const QMetaMethod &signal)
 
virtual void disconnectNotify (const QMetaMethod &signal)
 

Properties

float spawnStride
 Distance between spawned particles in the WaterBody, as a scale of particle size. More...
 
- Properties inherited from ParticleEmitterLogic
QColor color
 Color of spawned particles. More...
 
float pauseDistance
 Distance units from viewport edge to automatically pause the emitter. More...
 
ParticleLayer layer
 Layer to spawn particles on. More...
 
- Properties inherited from EmitterLogic
int requestedMaxEntityCount
 User-defined maximum number of entities to spawn. More...
 
int supportedMaxEntityCount
 Class-defined maximum number of entities to spawn. More...
 
int maxEntityCount
 Actual maximum number of entities to spawn, bounded by both requestedMaxEntityCount and supportedMaxEntityCount. More...
 
int entityCount
 Number of spawned entities still in existence. More...
 
float spawnRate
 Number of entities spawned per frame (i.e. each non-paused call to update()). More...
 
float spawnVelocity
 Forward velocity for spawned entities. More...
 
float spawnSpread
 Horizontal axis spread to apply to spawned entities. More...
 
float spawnSpray
 Divergence factor affecting the amount entities will stray from the direction of the emitter. More...
 
bool spawnRandom
 true if SpawnParameters are pseudo randomized, or patterned if false. More...
 
float timeOn
 Number of seconds, in game time, the emitter will stay on in one cycle. More...
 
float timeOff
 Number of seconds, in game time, the emitter will stay off in one cycle. More...
 
float transitionOnTime
 Number of seconds, in game time, the emitter takes to turn on. More...
 
float transitionOffTime
 Number of seconds, in game time, the emitter takes to turn off. More...
 
float decayTime
 Number of seconds, in game time, before the entity is destroyed. More...
 
float decayTimeRandomLength
 Maximum time delta an entity can randomly stay alive if spawnRandom is true. More...
 
bool paused
 Whether or not this emitter should spawn entities. More...
 
- Properties inherited from Logic
Actor actor
 Parent actor that is affected by this Logic's behavior. More...
 
bool active
 Whether or not Engine calls update() on this Logic during the Engine::LOGICS_PHASE. More...
 
- Properties inherited from QObject
 objectName
 

Additional Inherited Members

- Static Public Member Functions inherited from QObject
QString tr (const char *sourceText, const char *disambiguation, int n)
 
QString trUtf8 (const char *sourceText, const char *disambiguation, int n)
 
QMetaObject::Connection connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, Functor functor)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type)
 
bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)
 
bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
 
bool disconnect (const QMetaObject::Connection &connection)
 
bool disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method)
 

Detailed Description

Creates a body of water formed from WaterParticles.

When the level starts (i.e. init() is called), this class spawns enough particles to fill actor's Body shape.

Note
This class changes the default of requestedMaxEntityCount to -1, making the default bound on particles spawned to be the number of particles to fill the body of water.

Constructor & Destructor Documentation

WaterBodyLogic::WaterBodyLogic ( )

Constructs a WaterBodyLogic.

Member Function Documentation

virtual QRectF WaterBodyLogic::getEmitterWorldBounds ( )
overrideprotectedvirtual

Returns the bounding box of this emitter in world coordinates.

Reimplemented from ParticleEmitterLogic.

virtual int WaterBodyLogic::getSupportedMaxEntityCount ( ) const
inlineoverridevirtual

Returns the maximum number of particles that can be spawned by the class (i.e. the maximum number of particles that can fit in the actor's Body shape.

Reimplemented from EmitterLogic.

virtual void WaterBodyLogic::init ( )
overridevirtual

Spawns initial particles to fill the body of water.

Reimplemented from EmitterLogic.

virtual void WaterBodyLogic::onPausedChanged ( )
overrideprotectedvirtual

Notifies WaterBodyLogic to respawn enough particles to fill actor's Body shape if the emitter has because unpaused.

Reimplemented from ParticleEmitterLogic.

void WaterBodyLogic::spawnStrideChanged ( )
signal

Emitted when spawnStride changes.

virtual void WaterBodyLogic::update ( )
overridevirtual

Spawns particles to fill the WaterBody if necessary and decays particles outside of the actor's Body bounding box.

Reimplemented from ParticleEmitterLogic.

Property Documentation

float WaterBodyLogic::spawnStride

Distance between spawned particles in the WaterBody, as a scale of particle size.