class Ast: public GameObj

This class represent a generic asteroid

Inheritance:


Public Fields

[more]float size
The radius (mt) of the Asteroid
[more]int strenght
How resistent is an asteroid
[more] Sub
The vector of the Sub-asteroids

Public Methods

[more] Ast()
default constructor sets also the radius
[more] Ast(const Point3f &_p, const float _angle, const Point3f &_v, float _av, float _size)
Specialized constructor to set also angular velocity and size
[more]int Draw()
Draw the asteroid shape
[more]void Explode(list<Ast *> &AL, list<GameObj *> &OL)
Make the asteroid explode
[more]void GenerateSub()
Generate in a preprocessing step all the sub asteroids

Public

[more] LargeSize=12, MediumSize=6, SmallSize=3
Default Sizes of Asteroids

Inherited from GameObj:

Public Fields

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

Public Methods

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

Documentation

This class represent a generic asteroid. Version History

o LargeSize=12, MediumSize=6, SmallSize=3
Default Sizes of Asteroids The asteroids has only three valid sizes. When an asteroid explode it splits into two (or more) smaller asteroids

ofloat size
The radius (mt) of the Asteroid

oint strenght
How resistent is an asteroid.

o Ast()
default constructor sets also the radius

o Ast(const Point3f &_p, const float _angle, const Point3f &_v, float _av, float _size)
Specialized constructor to set also angular velocity and size

oint Draw()
Draw the asteroid shape. In this base class it is just a square with the give size.

ovoid Explode(list<Ast *> &AL, list<GameObj *> &OL)
Make the asteroid explode. In this base class do nothing. (i'm lazy); see the Ast3DFract explode to find something of more interesting.

ovoid GenerateSub()
Generate in a preprocessing step all the sub asteroids. see the Ast3DFract GenerateSub() to find something of more interesting.

o Sub
The vector of the Sub-asteroids. These Sub-asteroid are generate by the GenerateSub() func and used when the the asteroid itself explode.


Direct child classes:
Ast3DFract
Ast3D

Alphabetic index HTML hierarchy of classes or Java



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