-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSphere.h
53 lines (44 loc) · 1.17 KB
/
Sphere.h
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
#ifndef _SPHERE_3D_H
#define _SPHERE_3D_H
#include <GL/freeglut.h>
#include <math.h>
#include <stdio.h>
#include "Vector3D.h"
#include "Vector4D.h"
#include "Object3D.h"
namespace GLScene
{
/**
* TSphere class
* Params: radius of the sphere or the 3 radius of the ellipsoïd over x, y and z
* Params: position (default (0,0,0))
* The sphere/ellipsoïd is centered to it's position
*/
class TSphere : public TObject3D
{
private:
GLfloat radius;
TVector3D radius3D;
bool IsSphere;
protected:
public:
TSphere(GLfloat _radius, TVector3D *pos = NULL);
TSphere(TVector3D _radius, TVector3D *pos = NULL);
TSphere(GLfloat _radius, const TVector3D &pos);
TSphere(TVector3D _radius, const TVector3D &pos);
virtual ~TSphere();
void SetRadius(GLfloat _radius)
{
radius = _radius;
IsSphere = true;
}
void SetRadius(TVector3D _radius)
{
radius3D = _radius;
IsSphere = false;
}
void virtual DoDisplay(TDisplayMode mode = dmRender);
};
} // namespace GLScene
//---------------------------------------------------------------------------
#endif // _SPHERE_3D_H