-
Notifications
You must be signed in to change notification settings - Fork 0
/
Orbital.cpp
executable file
·101 lines (79 loc) · 1.93 KB
/
Orbital.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
#include "Orbital.h"
Orbital::Orbital()
{
setObjRadius(0.0f);
setOrbitalRadius(0.0f);
this->setCentreAbout(0,0,0);
this->setActualPosition(0,0,0);
colour.x =0.0; colour.y =0.0;
colour.z= 0.0;
setColour(colour);
}
Orbital::Orbital(const float &Objradius, const float &OrbitalRadius)
{
this->ObjRadius = Objradius;
this->OrbitalRadius = OrbitalRadius;
vector<GLfloat> colour;
colour.x =1.0;
colour.y =1.0;
colour.z= 1.0;
setColour(colour);
}
void Orbital::preDrawSetup()
{
glMatrixMode(GL_MODELVIEW); //loads the model view matrix
glPushMatrix(); //pushes the current model view matrix down
//glScaled(2,2,2);
}
void Orbital::postDrawDeSetup()
{
glPopMatrix();//pops the current model view matrix
}
void Orbital::setCentreAbout(const float &x, const float &y, const float &z)
{
this->centreAbout.x = x; // set the x y z centre about rotation vector
this->centreAbout.y = y;
this->centreAbout.z = z;
}
void Orbital::setActualPosition(const float &x, const float &y, const float &z)
{
this->actualPosition.x = x;// set the x y actualPosition vector
this->actualPosition.y = y;
this->actualPosition.z = z;
}
vector<GLfloat> Orbital::getCentreAbout() const
{
return centreAbout;
}
vector<GLfloat> Orbital::getActualPosition() const
{
return actualPosition;
}
double Orbital::getObjRadius() const
{
return ObjRadius;
}
void Orbital::setObjRadius(double value)
{
ObjRadius = value;
}
double Orbital::getOrbitalRadius() const
{
return OrbitalRadius;
}
void Orbital::setOrbitalRadius(double value)
{
OrbitalRadius = value;
}
void Orbital::setColour(const vector<GLfloat> value)
{
colour = value;
}
void Orbital::setNeedsRedraw(const bool &value)
{
needsRedraw = value;
}
vector<GLfloat> Orbital::getColour() const
{
return colour;
}