Driving Example

Driving Template/Example

Located in ExampleScripts- Driving

In the ExampleScripts- Driving folder you can find an example that shows how you can add driving a vehicle to your application, as well as test out how this works. 

For desktop use WASD keys and mouse and the , and . keys to accelerate/decelerate

For HMD, use RH Trigger to go forward, LH Trigger to brake and go back, thumbstick to go left and right and the B, and A keys  to accelerate/decelerate

Use the WASD and X and Z keys to reposition your viewpoint in the car (T,F,G,H if in desktop)


You can change the environment after env = 

and change the car model to use your own model after car = 

To change the button mappings to whichever driving vizconnect you're using navigate to the vizconnect file

(in utils/vizconnect_configs) and then to Advanced- Transports- Driving- Mappings and Acceleration/Deceleration under "Events". 

Here in vizconnect you can also swap out what trackers you are using (for instance if you are using a steering wheel or xbox controller)

After a session is run you can use the SessionReplay and it will show the playback of your session with the car being moved around the scene

There are also 3 more advanced versions you can request from sales@worldviz.com , an updated version of this one that includes toggling on and off of day and night with headlights, a 360 video driving simulator that combines 3D models and 360 videos and a flying simulator. 

Adding ramps/elevation detection (1.9.8 or higher)

To add collision to the driving example add this line at the top of your script

from utils import collision

Then after the "updateCarTransform" function add:

c = collision.Collision()