mElite
1.0
An Elite clone based on TextElite by Jan-Philipp Kappmeier and Melanie Schmidt.
|
A real drawing class that can render triangle mesh net based objects. More...
#include <ModelObject.h>
Public Member Functions | |
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. | |
virtual void | draw () |
Draws the object. | |
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. | |
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. | |
A real drawing class that can render triangle mesh net based objects.
It's derived from the abstract GraphicsObject and implements the draw() method. A display list has to be submitted to this class and this display list is executed each time the draw method is called. Therefore no color, texture and other information is needed.
Definition at line 20 of file ModelObject.h.
ModelObject::ModelObject | ( | GLuint | displayList | ) |
Creates a model object and sets up the display List.
displayList | The display list number returned by OpenGL |
Definition at line 20 of file ModelObject.cpp.
ModelObject::ModelObject | ( | float | r, |
GLuint | displayList | ||
) |
Creates a model object and sets up the display List.
r | The object radius |
displayList | The display list number returned by OpenGL |
Definition at line 37 of file ModelObject.cpp.
ModelObject::ModelObject | ( | Vector3 | position, |
float | r, | ||
GLuint | displayList | ||
) |
Creates a model object and sets up the display List.
position | The position as Vector3 |
r | The object radius |
displayList | The display list number returned by OpenGL |
Definition at line 56 of file ModelObject.cpp.
ModelObject::ModelObject | ( | float | x, |
float | y, | ||
float | z, | ||
float | r, | ||
GLuint | displayList | ||
) |
Creates a model object and sets up the display List.
x | The x-position |
y | The y-position |
z | The z-position |
r | The object radius |
displayList | The display list number returned by OpenGL |
Definition at line 80 of file ModelObject.cpp.
ModelObject::~ModelObject | ( | void | ) |
The destructor has nothing to clean up.
Definition at line 87 of file ModelObject.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.
Implements GraphicsObject.
Reimplemented in SpaceShip, SpaceStation, and abstract.
Definition at line 97 of file ModelObject.cpp.