class Exp: public GameObj

This class represent an explosion

Inheritance:


Public Fields

[more]int ttl
Time To Live (expressed in msec)
[more]Exp* LightOwner[3]
Who is the owner of the three explosion lights

Public Methods

[more] Exp()
Minimal Constructor
[more]void 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)
It must update and check the remaining Time To Live (TTL) of the bullet and disactivating it if necessary

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()

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
Note that this class is very similar to bullet (same ttl). Probably in next versions we will subclass Exp and Bullet from a intermediate Timed class.
o Exp()
Minimal Constructor

oint ttl
Time To Live (expressed in msec). Same of the bullet...

ovoid 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)
It must update and check the remaining Time To Live (TTL) of the bullet and disactivating it if necessary. Same code of bullet...


This class has no child classes.

Alphabetic index HTML hierarchy of classes or Java



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