vtlib - Vehicles

vtlib and Vehicles

Back in 1998-2000, there was a lot of vehicle functionality in the VTP. Cars and buses drove around the road network obeying traffic laws, airplanes flew overhead. But, the vehicle models were removed from the VTP distro when we lost our art path, and the Vehicle code was disabled and not kept up to date. That was around 2001 when the VTP was ported from DSM/PSM to OSG.

Since then, there has not been a good way to get the vehicle models out of 3DS MAX and into the VTP. Also, there has been a lack of interest: nobody has volunteered to revive the art path or vehicle functionality, nor has anyone yet hired me to do so.

Existing Vehicle support

As of October 2004, this code is in Enviro, but not exposed to the non-programming user.

class Vehicle

This class represents a single instance of a Vehicle on the terrain.  For example, if you have ten cars on a road, each car is a Vehicle.  Because Vehicle is a subclass of vtTransform, you can move your vehicles the same way you would any other object.

class VehicleType

This class describes a kind of vehicle, for example a "1996 Jeep Grand Cherokee", or a "Boeing 747".  It has one or more 3D models, for up to several levels of detail, in a base color.  When needed, you can call VehicleType::CreateVehicle() which creates and returns a Vehicle to you.

The intention is that vehicle models will follow the Vehicle Modelling Conventions.

class RoadFollowEngine

This class allows you to assign a ground vehicle to follow a roadmap.  The behavior is simple, traversing the topology of the roadmap at a fixed speed.

class CarEngine

This class is more sophisticated - speeding up and slowing down gradually, obeying the control restrictions at roadmap nodes such as red lights stop signs, turning the wheels of the vehicle at the appropriate rate.  However, this code has not kept up to date so it will have to be re-written at some point.

VehicleManager::SetupVehicles()
VehicleManager::CreateVehicle()

These method provide a convenient way to set up some vehicle types and create vehicles from them.

Lots to do...