class GameObj

This class represent a generic game object, with its speed, position etc

Inheritance:


Public Fields

[more]Point3f p
Position of a generic object in the game
[more]Point3f axis
Rotation Axis
[more]float angle
Direction (in degree)
[more]Point3f v
Speed Component (mt / sec)
[more]float av
Angular Speed (deg / sec)
[more]bool active
If the object is active or not

Public Methods

[more] GameObj()
Default constructor
[more] GameObj(const Point3f &_p, const float _angle)
constructor with given position and direction
[more] GameObj(const Point3f &_p, const float _angle, const Point3f &_v)
constructor with given position and direction and velocity
[more]void Draw()
Basic Redraw Function it does nothing
[more]void Update(int t)
Basic update function
[more]Point3f VDir()
Return the unitary direction vector


Documentation

This class represent a generic game object, with its speed, position etc.. This class is the base class that is used to derive all the objects represented in the game: asteroids, ships bullets explosion and so on. Each GameObj has a specific position in the game space, a velocity vector, a heading (direction) angle (that can be obviously different from the velocity direction), a main rotation axis and an angular speed (think of asteroids inertia).
o GameObj()
Default constructor

o GameObj(const Point3f &_p, const float _angle)
constructor with given position and direction

o GameObj(const Point3f &_p, const float _angle, const Point3f &_v)
constructor with given position and direction and velocity

oPoint3f p
Position of a generic object in the game

oPoint3f axis
Rotation Axis

ofloat angle
Direction (in degree)

oPoint3f v
Speed Component (mt / sec)

ofloat av
Angular Speed (deg / sec)

obool active
If the object is active or not

ovoid Draw()
Basic Redraw Function it does nothing. All derived classes should provide their own Draw functions.

ovoid Update(int t)
Basic update function. It updates the position and the direction of the object according its current speed and the elapsed time (expressed as millisec).

oPoint3f VDir()
Return the unitary direction vector.


Direct child classes:
Ship
Exp
Bullet
Ast

Alphabetic index HTML hierarchy of classes or Java



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