Changeset 2080 in orxonox.OLD for orxonox/branches/chris/src/track.cc
- Timestamp:
- Jul 6, 2004, 10:29:05 PM (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/chris/src/track.cc
r2068 r2080 12 12 13 13 ### File Specific: 14 main-programmer: ...14 main-programmer: Christian Meyer 15 15 co-programmer: ... 16 16 */ … … 21 21 using namespace std; 22 22 23 24 25 Track::Track () 23 Track::Track (Uint32 number, Uint32 next, Vector* start, Vector* finish) 26 24 { 25 ID = number; 26 offset = start; 27 end = finish; 28 nextID = next; 27 29 } 28 30 … … 33 35 void Track::map_camera (Location* lookat, Placement* camplc) 34 36 { 37 Line trace(*offset, *end - *offset); 38 float l = trace.len (); 39 40 camplc->r = trace.r + (trace.a * ((lookat->dist-10.0) / l)) + Vector(0,0,5.0); 41 camplc->w = Rotation( (trace.r + (trace.a * ((lookat->dist) / l))) - camplc->r); 35 42 } 36 43 37 voidTrack::map_coords (Location* loc, Placement* plc)44 bool Track::map_coords (Location* loc, Placement* plc) 38 45 { 46 Line trace(*offset, *end - *offset); 47 float l = trace.len (); 39 48 49 if( loc->dist > l) 50 { 51 loc->dist -= l; 52 loc->part = nextID; 53 return true; 54 } 55 56 Rotation dir(trace.a); 57 58 plc->r = trace.r + (trace.a * ((loc->dist) / l)) + rotate_vector( loc->pos, dir); 59 plc->w = dir * loc->rot; 60 61 return false; 62 } 63 64 void Track::post_enter (WorldEntity* entity) 65 { 66 } 67 68 void Track::post_leave (WorldEntity* entity) 69 { 70 } 71 72 void Track::tick (float deltaT) 73 { 40 74 } 41 75
Note: See TracChangeset
for help on using the changeset viewer.