Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to start developing?
04-18-2008, 02:47 AM,
#1
How to start developing?
Hi *,

any hints on where to start on "getting into" the code of Vdrift? Unfortunately the most interesting sections in the wiki are not yet written ("programming methology" and "class structure").

I am mainly interested in altering the audio and head-up-display parts of Vdrift: Something like
Code:
if foo then play audio x or if bar then display y

Thanks in advance
Reply
04-18-2008, 10:03 PM,
#2
 
All of the HUD drawing code is in the VAMOSWORLD:Big GrinrawHUD function in vamosworld.cpp. The VAMOSWORLD class is unfortunately a messy, miscellaneous class full of random junk, but the DrawHUD function is relatively straight forward. You can draw a texture as a 2D object with the game.utility.Draw2D function, passing in normalized x & y screen coordinates (so, ranging from 0 to 1) for the upper left and lower right corners, and then a TEXTURE_HANDLE object.

The sound classes are in sound.cpp and are pretty simple to use. You ask the SOUND object (game.sound) for a new sound source (SOUND::NewSource) giving a path to the .wav or .ogg sound file (which is just a buffername), and then you use the SOUNDSOURCE class's public interfaces to control the properties of the sound source (like, to play and stop it, to reposition it in the world, or to turn off the 3D positioning).

What sort of HUD/audio projects did you have in mind?
Reply
04-21-2008, 02:24 AM,
#3
 
thanks joevenzon for your reply.

joevenzon Wrote:What sort of HUD/audio projects did you have in mind?

I want to use Vdrift as basis for my prototype on HCI in automotive cockpits. And because I am trying to model visual (i.e. HUD), acoustical (i.e. sound output) and haptic (i.e. force-feedback) outputs, I asked where to find those in the Vdrift source code.

Actually, I did not yet ask, where to find the force-feedback code, but I guess it is in forcefeedback.cpp Smile
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)