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
SpinningObject.cpp
Go to the documentation of this file.
1 
6 #include "SpinningObject.h"
7 
13  m_axis.x = 0;
14  m_axis.y = 1;
15  m_axis.z = 0;
16  m_speed = 0;
17 }
18 
24  m_axis.x = 0;
25  m_axis.y = 1;
26  m_axis.z = 0;
27  m_speed = 0;
28 }
29 
36 SpinningObject::SpinningObject( GLfloat x, GLfloat y, GLfloat z ) : GameObject( x, y, z ) {
37  m_axis.x = 0;
38  m_axis.y = 1;
39  m_axis.z = 0;
40  m_speed = 0;
41 }
42 
47 }
48 
54  m_axis = axis;
55 }
56 
63 void SpinningObject::setAxis( float x, float y, float z ) {
64  m_axis.x = x;
65  m_axis.y = y;
66  m_axis.z = z;
67 }
68 
73 void SpinningObject::setSpeed( float speed ) {
74  m_speed = speed;
75 }
76 
80 void SpinningObject::spin( void ) {
81  glRotatef( glutGet(GLUT_ELAPSED_TIME) * m_speed, m_axis.x, m_axis.y, m_axis.z ); // rotation for a day
82 }