Last change
on this file since 3020 was
3018,
checked in by bensch, 20 years ago
|
orxonox/branches/bezierTrack: moved Curve to its own file. I expect this class to be bigger than I thought at the beginning:
- Class Curve and its subclasses:
a) BezierCurve
b) closedBezierCurve
c) Nurbs
d) any other curve that might occure
this will take some time and many hours of thinking so please help
|
File size:
1.3 KB
|
Rev | Line | |
---|
[2141] | 1 | /*! |
---|
| 2 | \file track.h |
---|
| 3 | \brief Basic level architecture |
---|
| 4 | */ |
---|
[2068] | 5 | |
---|
| 6 | #ifndef TRACK_H |
---|
| 7 | #define TRACK_H |
---|
| 8 | |
---|
[2101] | 9 | #include "stdincl.h" |
---|
[3018] | 10 | #include "curve.h" |
---|
[2101] | 11 | |
---|
[2141] | 12 | //! The Red Line through a level |
---|
| 13 | /** |
---|
[2551] | 14 | Handles level boundaries, bound movement mapping, camera placement and scripting. |
---|
| 15 | To create special levels with special camera movement, rules or whatever, derive from this base class. |
---|
[2141] | 16 | */ |
---|
[2068] | 17 | class Track |
---|
| 18 | { |
---|
| 19 | private: |
---|
[2551] | 20 | Uint32 ID; |
---|
| 21 | Vector* offset; |
---|
| 22 | Vector* end; |
---|
[3010] | 23 | BezierCurve curve; |
---|
[2551] | 24 | // Vector* direction; // unity direction vector: it is costy to always recalculate it |
---|
| 25 | //Vector* up; // direction where up is ment to be - diffuse in space, eh? |
---|
| 26 | //Vector* traverse; // right-left |
---|
| 27 | Uint32 nextID; |
---|
| 28 | |
---|
[3010] | 29 | Track* next; |
---|
| 30 | Track* previous; |
---|
[2068] | 31 | |
---|
| 32 | public: |
---|
[2636] | 33 | Track (); |
---|
[3010] | 34 | |
---|
[2068] | 35 | ~Track (); |
---|
[2636] | 36 | virtual void init(); |
---|
[3010] | 37 | |
---|
[3013] | 38 | void addPoint (Vector point); |
---|
| 39 | void addHotPoint (Vector hotPoint); |
---|
[2636] | 40 | |
---|
[3014] | 41 | Vector getPos(float t); |
---|
[3015] | 42 | Vector getDir (float t); |
---|
| 43 | |
---|
[3014] | 44 | |
---|
[2636] | 45 | virtual void post_enter (WorldEntity* entity); // handle coordinate transition in here !!! (when dist < 0 or dist > lasttracklenght) |
---|
| 46 | virtual void post_leave (WorldEntity* entity); |
---|
| 47 | virtual void tick (float deltaT); |
---|
| 48 | virtual void map_camera (Location* lookat, Placement* camplc); |
---|
| 49 | virtual bool map_coords (Location* loc, Placement* plc); // this should return true if the entity left track boundaries |
---|
[2068] | 50 | }; |
---|
| 51 | |
---|
| 52 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.