mElite  1.0
An Elite clone based on TextElite by Jan-Philipp Kappmeier and Melanie Schmidt.
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | List of all members
ModelObject Class Reference

A real drawing class that can render triangle mesh net based objects. More...

#include <ModelObject.h>

Inheritance diagram for ModelObject:
GraphicsObject GameObject SpaceShip SpaceStation abstract PlayerObject

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.
 

Detailed Description

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.

Constructor & Destructor Documentation

ModelObject::ModelObject ( GLuint  displayList)

Creates a model object and sets up the display List.

Parameters
displayListThe 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.

Parameters
rThe object radius
displayListThe 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.

Parameters
positionThe position as Vector3
rThe object radius
displayListThe 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.

Parameters
xThe x-position
yThe y-position
zThe z-position
rThe object radius
displayListThe 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.

Member Function Documentation

void ModelObject::draw ( void  )
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.

See Also
SpaceStation::draw() where this function is combined with a spinning object.

Implements GraphicsObject.

Reimplemented in SpaceShip, SpaceStation, and abstract.

Definition at line 97 of file ModelObject.cpp.


The documentation for this class was generated from the following files: