Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Vehicle Activated Signs - VAS
09-25-2008, 10:19 AM,
#8
 
To get the car's position you can put a debug printout inside a function like VAMOSWORLD:Big GrinrawHUD():
Code:
Vamos_Geometry::Three_Vector position = current_focus->car->chassis().position();
VERTEX car_pos;
car_pos.x = position[0]; //conversion to track coordinate system
car_pos.y = position[2];
car_pos.z = -position[1];
car_pos.DebugPrint();
You can then use this info to figure out where to place your sign. You can also use it to determine how close your car is to your sign.

If you look at VAMOSWORLD:Big GrinrawHUD() for example you'll see how the speed is queried:
Code:
float kph = Vamos_Geometry::m_s_to_km_h (current_focus->car->chassis().cm_velocity().magnitude());
if (kph < 0)
        kph = -kph;
float mph = kph * 0.621371192;

Sounds like things are progressing quickly with your demo! Nice work.
Reply


Messages In This Thread
Vehicle Activated Signs - VAS - by lino - 09-22-2008, 04:22 PM
[No subject] - by lino - 09-23-2008, 10:31 AM
[No subject] - by joevenzon_phpbb2_import3 - 09-23-2008, 10:36 PM
[No subject] - by lino - 09-24-2008, 09:44 AM
[No subject] - by joevenzon_phpbb2_import3 - 09-24-2008, 11:45 AM
[No subject] - by lino - 09-25-2008, 04:12 AM
[No subject] - by joevenzon_phpbb2_import3 - 09-25-2008, 10:19 AM
[No subject] - by lino - 09-25-2008, 10:46 AM
[No subject] - by lino - 09-25-2008, 01:51 PM
[No subject] - by lino - 09-26-2008, 06:00 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)