mElite
1.0
An Elite clone based on TextElite by Jan-Philipp Kappmeier and Melanie Schmidt.
|
Represents a space station. More...
#include <SpaceStation.h>
Public Member Functions | |
SpaceStation (float r, GLuint displayList) | |
Initializes the space station. | |
SpaceStation (Vector3 position, float r, GLuint displayList) | |
Initializes the space station. | |
SpaceStation (float x, float y, float z, float r, GLuint displayList) | |
Initializes the space station. | |
~SpaceStation (void) | |
Destructor. | |
Vector3 | getOutVector (void) |
Vector3 | getOutPosition (void) |
bool | test (const Vector3 &position) |
void | draw () |
Draws the object. | |
Public Member Functions inherited from SpinningObject | |
SpinningObject () | |
SpinningObject (Vector3 position) | |
SpinningObject (GLfloat x, GLfloat y, GLfloat z) | |
~SpinningObject (void) | |
void | setAxis (Vector3 axis) |
void | setAxis (float x, float y, float z) |
void | setSpeed (float speed) |
void | spin (void) |
Public Member Functions inherited from GameObject | |
GameObject (void) | |
The constructor creates the object. The position is set to zero by default. | |
GameObject (Vector3 position) | |
The constructor creates the object and gives it a position in the scene. | |
GameObject (float x, float y, float z) | |
The constructor creates the object and gives it a position in the scene. | |
~GameObject (void) | |
Destructor. Does nothing. | |
virtual Vector3 | getPos (void) |
Returns the current position as Vector3 triple. | |
void | setPos (float x, float y, float z) |
Sets the current position. | |
void | setPos (Vector3 position) |
Sets the current position. | |
Public Member Functions inherited from ModelObject | |
ModelObject (GLuint displayList) | |
Creates a model object and sets up the display List. | |
ModelObject (float r, GLuint displayList) | |
Creates a model object and sets up the display List. | |
ModelObject (Vector3 position, float r, GLuint displayList) | |
Creates a model object and sets up the display List. | |
ModelObject (float x, float y, float z, float r, GLuint displayList) | |
Creates a model object and sets up the display List. | |
~ModelObject (void) | |
The destructor has nothing to clean up. | |
Public Member Functions inherited from GraphicsObject | |
GraphicsObject (void) | |
The constructor creates the object. | |
GraphicsObject (GLfloat r) | |
The constructor creates the object. | |
GraphicsObject (Vector3 position, float r) | |
Creates an graphical object. | |
GraphicsObject (float x, float y, float z, float r) | |
Creates a graphical object. | |
~GraphicsObject (void) | |
Destructor. | |
float | getRadius (void) |
Returns the radius of the object, usable for view frustum culling. | |
float | getCollisionRadius (void) |
Returns the radius of the object, usable for collision detection. | |
Represents a space station.
It is derived from the ModelObject class which means, the station is drawable using the base draw() method. As a station does not move but is rotating it inherits from the clas SpinningObject.
Definition at line 18 of file SpaceStation.h.
SpaceStation::SpaceStation | ( | float | r, |
GLuint | displayList | ||
) |
Initializes the space station.
The radius and the display list have to be submitted if an object is initialized. The starting position is set to the origin.
r | the radius |
displayList | the display list |
Definition at line 17 of file SpaceStation.cpp.
SpaceStation::SpaceStation | ( | Vector3 | position, |
float | r, | ||
GLuint | displayList | ||
) |
Initializes the space station.
The radius and the display list have to be submitted if an object is initialized.
position | the position as Vector3 |
r | the radius |
displayList | the display list |
Definition at line 28 of file SpaceStation.cpp.
SpaceStation::SpaceStation | ( | float | x, |
float | y, | ||
float | z, | ||
float | r, | ||
GLuint | displayList | ||
) |
Initializes the space station.
The radius and the display list have to be submitted if an object is initialized.
x | the x-position |
y | the y-position |
z | the z-position |
r | the radius |
displayList | the display list |
Definition at line 41 of file SpaceStation.cpp.
SpaceStation::~SpaceStation | ( | void | ) |
Destructor.
Definition at line 47 of file SpaceStation.cpp.
|
virtual |
Draws the object.
Draws the object using the display list. Therefore no textur and color information is needed. All actions that are necessary to draw the object should take place in the list. It is possible to create a derived class that does something else and calls this draw() method to draw the model.
Reimplemented from ModelObject.
Definition at line 51 of file SpaceStation.cpp.
Vector3 SpaceStation::getOutPosition | ( | void | ) |
Definition at line 134 of file SpaceStation.cpp.
Vector3 SpaceStation::getOutVector | ( | void | ) |
Definition at line 72 of file SpaceStation.cpp.
bool SpaceStation::test | ( | const Vector3 & | position | ) |
Definition at line 168 of file SpaceStation.cpp.