File: wall.h

package info (click to toggle)
flying 6.20-6
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k, lenny
  • size: 752 kB
  • ctags: 1,873
  • sloc: cpp: 10,966; makefile: 189
file content (63 lines) | stat: -rw-r--r-- 1,496 bytes parent folder | download | duplicates (4)
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
#ifndef _wall_h
#define _wall_h

#ifndef _object_h
#	include "object.h"
#endif
#ifndef _vec2_h
#	include "vec2.h"
#endif

//
// -------------------------------------------------------------------------
//   class Wall:  Begrenzungs-Objekt
// -------------------------------------------------------------------------
//

class Wall : public Object {
	public:
		Wall( double x1, double y1, double x2, double y2 );
		Wall( const Vec2 &v1, const Vec2 &v2 );
		virtual ~Wall();

		virtual Real HitFromBall( Ball *b );
		virtual void CollideWithBall( Ball *b );
		virtual void Info();

	protected:
		Vec2	p1,p2;

		Vec2	d;			// p2-p1
		Vec2	ds;		// normierter Vektor senkrecht zu d

friend class Pool;
};

//
// -------------------------------------------------------------------------
//   class XWall:  Wand ohne Begrenzung
// -------------------------------------------------------------------------
//

class XWall : public Wall {
	public:
		XWall( double x, double y1, double y2 ) : Wall(x,y1,x,y2)	{ ; }
		virtual ~XWall();
		Real HitFromBall( Ball *b );
		void	 CollideWithBall( Ball *b );
};
//
// -------------------------------------------------------------------------
//   class YWall:  Wand ohne Begrenzung
// -------------------------------------------------------------------------
//

class YWall : public Wall {
	public:
		YWall( double x1, double x2, double y ) : Wall(x1,y,x2,y)	{ ; }
		virtual ~YWall();
		Real HitFromBall( Ball *b );
		void	 CollideWithBall( Ball *b );
};

#endif