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
GraphicsObject Class Referenceabstract

Represents a basic drawable object. More...

#include <GraphicsObject.h>

Inheritance diagram for GraphicsObject:
GameObject ModelObject QuadricObject SpaceShip SpaceStation Planet abstract PlayerObject Star

Public Member Functions

 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.
 
virtual void draw (void)=0
 
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

Represents a basic drawable object.

It's derived from GameObject and so has a position. A pure virtual function draw() is provided to use in drawing procedures. Also graphical objects have a radius which is supposed to be used in some tests, such as visibility and collision testing.

Definition at line 19 of file GraphicsObject.h.

Constructor & Destructor Documentation

GraphicsObject::GraphicsObject ( void  )

The constructor creates the object.

The position and radius are set to 0 by default.

Definition at line 14 of file GraphicsObject.cpp.

GraphicsObject::GraphicsObject ( GLfloat  r)

The constructor creates the object.

The position is set to zero by default.

Parameters
rthe objects radius

Definition at line 23 of file GraphicsObject.cpp.

GraphicsObject::GraphicsObject ( Vector3  position,
float  r 
)

Creates an graphical object.

Needed is the position and the radius. The radius is used for collision detection and the view frustum culling.

Parameters
positionthe position of the object in 3-dimensional space
rthe radius of the object

Definition at line 35 of file GraphicsObject.cpp.

GraphicsObject::GraphicsObject ( float  x,
float  y,
float  z,
float  r 
)

Creates a graphical object.

Needed is the position and the radius. The radius is used for collision detection and the view frustum culling.

Parameters
xthe x-position of the object
ythe x-position of the object
zthe x-position of the object
rthe radius of the object

Definition at line 48 of file GraphicsObject.cpp.

GraphicsObject::~GraphicsObject ( void  )

Destructor.

Definition at line 55 of file GraphicsObject.cpp.

Member Function Documentation

virtual void GraphicsObject::draw ( void  )
pure virtual
float GraphicsObject::getCollisionRadius ( void  )

Returns the radius of the object, usable for collision detection.

Definition at line 62 of file GraphicsObject.cpp.

float GraphicsObject::getRadius ( void  )

Returns the radius of the object, usable for view frustum culling.

This function is basically the same as getCollisionRadius( void ). It is used, because some objects (as Planet) have two kinds of radius which allows to have collisions in another area than the actual object's size.

Definition at line 73 of file GraphicsObject.cpp.


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