3D models and environment #

Vehicles #

Rules for vehicle 3D models:

Hints for modeling vehicles in Blender

  • The forward direction is -Y (negative Y). This translates to +Z in Unity.
  • Use this Blender To Unity FBX Exporter to export the FBX file correctly for Unity.

A high quality vehicle 3D model also mets these conditions:

Interior #

Dashboard gauges and steering wheel must meet these requirements:

Typically, the center of rotation of the steering wheel is the center of the external circumference. Using the center of the logo as center of rotation can result in a very off-center rotation of the steering wheel.

Vehicle collider #

Convex vehicle collider

Game-ready 3D vehicles usually come with a simplified shape of the vehicle (collision mesh). The vehicle collider must be a convex collider (MeshCollider > Convex), or a set of convex colliders.

At least one convex collider is mandatory in the vehicle

A vehicle without colliders will exhibit a very weird and unnatural behavior as soon as the simulation starts, unless the inertia tensor is explicitly configured (Rigidbody.inertiaTensor).

VPWheelCollider components must be located inside the vehicle's colliders

Ensure that the top half of each VPWheelCollider component is enclosed within regular convex colliders belonging to the vehicle's main rigidbody. Otherwise, strange behaviors and side effects may happen when the vehicle enters in contact with other objects.

Good (left) and bad (right) positions for the VPWheelCollider with respect to the vehicle collider

Articulated vehicles #

Multi-body vehicles such as trucks with trailers can be attached together. Each part is a 3D model that can be setup as an independent vehicle with its own Vehicle Controller (i.e. trailers) or as a a separated rigidbody with all wheels configured in the main Vehicle Controller (i.e. articulated bus).

Add a VPVehicleJoint component at the transform representing the male plug:

Both bodies should be close enough to the connected position for preventing abrupt movements when the VPVehicleJoint gets enabled.

Each body must have its collider according to the collider specifications above.

Driver's view #

Configuring the head movement in the first person view provides a nice feeling of the inertia in the driver's view. Add a VPHeadMotion component to a child gameobject of the vehicle:

Scenery #

Work In Progress

TO-DO:

Colliders, continuity, player safety.

Roads & tracks do & dont's

Physic Materials #

TO-DO:

Unity physic materials for vehicles and environment.

Different grip levels on different surfaces.

Settings to represent asphalt, grass, concrete walls, tire walls, etc

Learned from Box2D: https://github.com/erincatto/Box2D/blob/master/Box2D/Box2D/Dynamics/Contacts/b2Contact.h