class Exp: public GameObjTimed

This class represent an explosion

Inheritance:


Public Fields

[more]Exp* LightOwner[3]
Who is the owner of the three explosion lights

Public Methods

[more] Exp()
Minimal Constructor
[more]int Draw()
It draw a simple disk
[more]void LightOffAll()
Initially all the lights are off; This is a static class member function therefore it can be called also without any class object instance (it is called in GameSession::Start())
[more]void LightOn()
Find a free light and enable it with the current position of the explosion
[more]void LightOff()
Turn off the light and free it
[more]void Update(int t)
If inactive turn light off

Inherited from GameObjTimed:

Public Fields

oint ttl

Inherited from GameObj:

Public Fields

oPoint3f p
oPoint3f axis
ofloat angle
oPoint3f v
ofloat av
obool active
oSphere3f B

Public Methods

oPoint3f VDir()
obool Collide(GameObj *o)
ovoid DrawBound()
obool operator < ( GameObj const & o ) const
obool operator == ( GameObj const & o ) const

Documentation

This class represent an explosion. Version History
  • 0.1 First Release (e.g. written only the defs without implementing or using it...)
  • 0.3 First concretely working release
  • 0.3s Added light management
  • 0.4s Subclassed from GameObjTimed, update should only turn off light
o Exp()
Minimal Constructor

oint Draw()
It draw a simple disk. The disk is drawn with a triangular fan transparent in the center and yellow on the border. Note that to draw with transparency we have to enable the blending. We have choosen to enable the blending only here for performance reasons. To avoid that other objects cover an explosions we disable the depth test and draw the explosion (that are contained in the generic ActiveObj list of the GameSession) as the last objects.

oExp* LightOwner[3]
Who is the owner of the three explosion lights. This is a static class member variable, therefore it is shared between all the instances of this class.

ovoid LightOffAll()
Initially all the lights are off; This is a static class member function therefore it can be called also without any class object instance (it is called in GameSession::Start())

ovoid LightOn()
Find a free light and enable it with the current position of the explosion. It store the "this" pointer into the LightOwner vector.

ovoid LightOff()
Turn off the light and free it. Only if there were a light allocated by this object.

ovoid Update(int t)
If inactive turn light off.


This class has no child classes.

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.