mElite
1.0
An Elite clone based on TextElite by Jan-Philipp Kappmeier and Melanie Schmidt.
Main Page
Classes
Files
File List
File Members
All
Classes
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
mElite
SpinningObject.cpp
Go to the documentation of this file.
1
6
#include "
SpinningObject.h
"
7
12
SpinningObject::SpinningObject
( ) :
GameObject
( ) {
13
m_axis.
x
= 0;
14
m_axis.
y
= 1;
15
m_axis.
z
= 0;
16
m_speed = 0;
17
}
18
23
SpinningObject::SpinningObject
(
Vector3
position ) :
GameObject
( position ) {
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
46
SpinningObject::~SpinningObject
(
void
) {
47
}
48
53
void
SpinningObject::setAxis
(
Vector3
axis ) {
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
}
Generated on Tue Oct 2 2012 14:38:38 for mElite by
1.8.2