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

A Star is a special type of Planet that has supports lighting. More...

#include <Star.h>

Inheritance diagram for Star:
Planet SpinningObject QuadricObject GameObject GraphicsObject GameObject

Public Member Functions

 Star (float planetRadius, float collisionRadius, GLuint textureName)
 Draws a star, which is basically only a planet with light. The default lightcolor is set to yellow, as the sun's color.
 
 Star (float x, float y, float z, float planetRadius, GLuint textureName)
 Draws a star, which is basically only a planet with light.
 
 Star (float x, float y, float z, float planetRadius, float collisionRadius, GLuint textureName)
 
 ~Star (void)
 Destructor.
 
GLvoid draw (GLvoid)
 Draws a star.
 
GLvoid setLightColor (Vector3 lightColor)
 
GLvoid setLightColor (float r, float g, float b)
 
GLvoid setPos (GLfloat x, GLfloat y, GLfloat z)
 
GLvoid setPos (Vector3 position)
 
- Public Member Functions inherited from Planet
 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

A Star is a special type of Planet that has supports lighting.

Definition at line 11 of file Star.h.

Constructor & Destructor Documentation

Star::Star ( float  planetRadius,
float  collisionRadius,
GLuint  textureName 
)

Draws a star, which is basically only a planet with light. The default lightcolor is set to yellow, as the sun's color.

Parameters
planetRadiusradius of the star itself
collisionRadiusradius used for collision detection
textureNamethe texture that is used for the star (as OpenGL texture)

Definition at line 15 of file Star.cpp.

Star::Star ( float  x,
float  y,
float  z,
float  planetRadius,
GLuint  textureName 
)

Draws a star, which is basically only a planet with light.

The default lightcolor is set to yellow, as the sun's color.

Parameters
xthe x-position of the star
ythe y-position of the star
zthe z-position of the star
planetRadiusradius of the star itself and crashing radius
textureNamethe index of the texture that is used

Definition at line 38 of file Star.cpp.

Star::Star ( float  x,
float  y,
float  z,
float  planetRadius,
float  collisionRadius,
GLuint  textureName 
)

Draws a star, which is basically only a planet with light. The default lightcolor is set to yellow, as the sun's color.

Parameters
xthe x-position of the star
ythe y-position of the star
zthe z-position of the star
planetRadiusradius of the star itself
collisionRadiusradius used for collision detection
textureNamethe OpenGL id for the texture that is used for the star

Definition at line 61 of file Star.cpp.

Star::~Star ( void  )

Destructor.

Definition at line 78 of file Star.cpp.

Member Function Documentation

GLvoid Star::draw ( GLvoid  )

Draws a star.

This drawing function uses the base planet function to draw the sun. Before this the light is color is set.

Definition at line 86 of file Star.cpp.

GLvoid Star::setLightColor ( Vector3  lightColor)

Sets the color of the emitting light. The used light is LIGHT0

Parameters
lightColora vector with the light color

Definition at line 101 of file Star.cpp.

GLvoid Star::setLightColor ( float  r,
float  g,
float  b 
)

Sets the color of the emitting light. The used light is LIGHT0

Parameters
rthe red component of the light
gthe green component of the light
bthe blue component of the light

Definition at line 111 of file Star.cpp.

GLvoid Star::setPos ( GLfloat  x,
GLfloat  y,
GLfloat  z 
)

Definition at line 117 of file Star.cpp.

GLvoid Star::setPos ( Vector3  position)

Definition at line 125 of file Star.cpp.


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