Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how to extract the speed of the car in runtime
05-03-2012, 11:25 AM,
#2
 
Hi kraessig.

What is going to be your receiver? The most simple way would be to write the velocity into an output stream I think. Then you would redirect it for further processing.

The only catch is that on windows stdout/stderr are redirected to stdout/stderr.txt by default.

In game.cpp line 898 is the cars update loop. If you are only interested in the values of the first car just do something like(to get velocity magnitude)
std::cout << cars.begin().GetSpeed() << std::endl;

To get the velocity in car space(forward direction is y-axis) you have to add a function to calculate it. Something like: quatRotate(-GetOrientation(), GetVelocity());


Maybe we should add it to the public interface.
Reply


Messages In This Thread
[No subject] - by NaN - 05-03-2012, 11:25 AM
[No subject] - by kraessig - 05-03-2012, 11:45 AM
[No subject] - by NaN - 05-03-2012, 12:12 PM
[No subject] - by kraessig - 05-10-2012, 07:23 AM
[No subject] - by NaN - 05-10-2012, 07:40 AM
[No subject] - by kraessig - 05-10-2012, 08:15 AM
[No subject] - by NaN - 05-10-2012, 09:02 AM
RE: - by cac1234 - 02-22-2017, 09:34 AM
[No subject] - by kraessig - 05-10-2012, 10:56 AM
[No subject] - by kraessig - 05-10-2012, 11:47 AM
[No subject] - by NaN - 05-10-2012, 12:06 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)