-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcube.h
56 lines (42 loc) · 1.18 KB
/
cube.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
54
55
56
#ifndef cube_h
#define cube_h
/*****************************************************************************
Plane Class
NAME:cube.h
DATE:17/12/1996
AUTHOR: Z.A. Nolan
*****************************************************************************/
// include vector class
#include "vector.h"
// and the colour class
#include "colour.h"
// and the line class
#include "line.h"
// and include the object class
#include "object.h"
class TCube :public TObject
{
private:
TVector _TopCorner ; // Top corner of the cube
TVector _BottomCorner ; // Bottom corner of the cube
int _Hits ; // number of hits needed to kill the block
TVector _LeftNormal ; // Normals
TVector _RightNormal ;
TVector _FrontNormal ;
TVector _BackNormal ;
TVector _TopNormal ;
TVector _BottomNormal ;
public:
// Constructors
TCube () ;
TCube (TVector BottomCorner,TVector TopCorner,
const TSurfaceProperties,int Position,int Hits) ;
// get the corner data
TVector TopCorner() ;
TVector BottomCorner() ;
// Intersection of a line and a plane
double Intersection(TVector &Normal,const TBall &Ball) const;
void Draw() ;
void Hit() ;
} ;
#endif