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
Planet Class Reference

#include <Planet.h>

Inheritance diagram for Planet:
SpinningObject QuadricObject GameObject GraphicsObject GameObject Star

Public Member Functions

 Planet (float planetRadius, float collisionRadius, GLuint textureName)
 Draws a planet with texture and spinning.
 
 Planet (float x, float y, float z, float planetRadius, GLuint textureName)
 Constructor wich sets the position and radius of the planet.
 
 Planet (float x, float y, float z, float planetRadius, float collisionRadius, GLuint textureName)
 Constructor wich sets the position and radius of the planet.
 
 ~Planet (void)
 Destructor.
 
void draw (void)
 Draws a planet with texture and spinning.
 
float getRotateSpeed (void)
 Get the current rotate speed.
 
void setRotateAngle (float angle)
 Sets the rotate angle.
 
void setRotateSpeed (float speed)
 Sets the speed that the planets use to rotate.
 
void setRadiusLineDrawing (bool draw)
 Enables and disables if the line on which the planet moves should be drawn.
 
Vector3 getPos ()
 Get the current position of the center of the planet.
 
- 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.
 
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 QuadricObject
 QuadricObject (GLuint textureName)
 
 QuadricObject (float r, GLuint textureName)
 
 QuadricObject (Vector3 position, float r, GLuint textureName)
 
 QuadricObject (float x, float y, float z, float r, GLuint textureName)
 
 ~QuadricObject (void)
 
Point4 getColor (void)
 
GLuint getTexture (void)
 
void setColor (Vector3 color)
 Sets the color used for drawing.
 
void setColor (float r, float g, float b)
 Sets the color used for drawing.
 
void setColor (float r, float g, float b, float a)
 Sets the color used for drawing, allows setting of alpha channel.
 
void setTexture (GLuint texture)
 Sets the texture used for drawing, if texturing is on.
 
- 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.
 

Additional Inherited Members

- Public Attributes inherited from QuadricObject
GLuint m_texture
 
Point4 m_color
 

Detailed Description

Definition at line 15 of file Planet.h.

Constructor & Destructor Documentation

Planet::Planet ( float  planetRadius,
float  crashRadius,
GLuint  textureName 
)

Draws a planet with texture and spinning.

The spinning is done by a SpinningObject, the texture is set through Drawable. The Planet itself is basically an quadric sphere. In order to run in the xz-area, the planet is rotated about 90 degrees.

Definition at line 18 of file Planet.cpp.

Planet::Planet ( float  x,
float  y,
float  z,
float  bothRadiuses,
GLuint  textureName 
)

Constructor wich sets the position and radius of the planet.

A planet has two different radiusses, the outer one gives the distance in which an vessel will crash onto the planet. In this version, both radiuses are the same.

Definition at line 36 of file Planet.cpp.

Planet::Planet ( float  x,
float  y,
float  z,
float  planetRadius,
float  crashRadius,
GLuint  textureName 
)

Constructor wich sets the position and radius of the planet.

A planet has two different radiusses, the outer one gives the distance in which an vessel will crash onto the planet. rotated about 90 degrees.

Definition at line 53 of file Planet.cpp.

Planet::~Planet ( void  )

Destructor.

Definition at line 64 of file Planet.cpp.

Member Function Documentation

GLvoid Planet::draw ( void  )
virtual

Draws a planet with texture and spinning.

The spinning is done by a SpinningObject, the texture is set through Drawable. The Planet itself is basically an quadric sphere. In order to run in the xz-area, the planet is rotated about 90 degrees. If the frustum is set to NULL, the planet is always drawn. If frustum is an actual object it is tested if the planet can be culled.

Implements GraphicsObject.

Definition at line 76 of file Planet.cpp.

Vector3 Planet::getPos ( void  )
virtual

Get the current position of the center of the planet.

Returns
The position after all the rotations have been done.

Reimplemented from GameObject.

Definition at line 112 of file Planet.cpp.

float Planet::getRotateSpeed ( void  )

Get the current rotate speed.

Definition at line 136 of file Planet.cpp.

void Planet::setRadiusLineDrawing ( bool  draw)

Enables and disables if the line on which the planet moves should be drawn.

Parameters
drawdefines whether it's true or not

Definition at line 162 of file Planet.cpp.

void Planet::setRotateAngle ( float  angle)

Sets the rotate angle.

This is the angle by which the planets are rotated when they are first drawn.

Parameters
anglethe angle

Definition at line 146 of file Planet.cpp.

void Planet::setRotateSpeed ( float  speed)

Sets the speed that the planets use to rotate.

Parameters
speedthe speed

Definition at line 154 of file Planet.cpp.


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