Changeset 2112 in orxonox.OLD for orxonox/branches/chris/src/track.cc
- Timestamp:
- Jul 12, 2004, 10:28:25 PM (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/chris/src/track.cc
r2101 r2112 42 42 void Track::map_camera (Location* lookat, Placement* camplc) 43 43 { 44 printf("Track|Mapping camera: %d (%f)\n", lookat->part, lookat->dist); 44 45 Line trace(*offset, *end - *offset); 45 46 float l = trace.len (); 46 47 48 // camplc->r = *offset + Vector(0,0,0.5); 49 // camplc->w = Quaternion (trace.a, Vector(0,0,1)); 50 47 51 camplc->r = trace.r + (trace.a * ((lookat->dist-10.0) / l)) + Vector(0,0,5.0); 48 camplc->w = Rotation( (trace.r + (trace.a * ((lookat->dist) / l))) - camplc->r); 52 camplc->w = Quaternion((trace.r + (trace.a * ((lookat->dist) / l)) - camplc->r), Vector(0,0,1)); 53 49 54 } 50 55 51 56 bool Track::map_coords (Location* loc, Placement* plc) 52 57 { 58 printf("Track|Mapping coords: %d (%f)\n", loc->part, loc->dist); 53 59 Line trace(*offset, *end - *offset); 54 60 float l = trace.len (); … … 61 67 } 62 68 63 Rotation dir(trace.a);69 Quaternion dir(trace.a, Vector(0,0,1)); 64 70 65 plc->r = trace.r + (trace.a * ((loc->dist) / l)) + rotate_vector( loc->pos, dir);71 plc->r = trace.r + (trace.a * ((loc->dist) / l)) + dir.apply(loc->pos); 66 72 plc->w = dir * loc->rot; 67 73
Note: See TracChangeset
for help on using the changeset viewer.