City Car Driving

City Car Driving

Not enough ratings
User Guide on Building Right-Hand Drive Car
By horunzhin.artem
To create a right-hand drive car based on the left-hand model, you need to refine the graphic model of the car, set up the configuration files and visualization function.
   
Award
Favorite
Favorited
Unfavorite
1. Model Refinement
Open the source file of the car interior, in this example it is a model called saloon. Select the body object and apply the Mirror modifier, which will reflect the interior along the X-axis:



Some elements, such as the dashboard, should not change in the left-hand drive version. Select the dashboard by choosing the Element type sub-object and apply the Mirror modifier again:



Now you can put the dashboard indicators and pointers back in place. To do this, select all these objects, move them closer to the desired place, and then using the snaps (Snaps Toggle tool) set them where you want:





After these manipulations, it is necessary to return the pivot (reference point) of each object to zero coordinates:



Together with the mirror image of the object, the scan was also reflected, so we need to fix it in places where it is necessary. To do this, select the problem place as a Polygon or Element sub-object and apply the Unwrap UVW modifier.

In the scan editing window, select the part of the scan that you want to flip and use Tools →
Flip Horizontal
or Flip Vertical, depending on whether the element is represented horizontally or vertically on the texture:



This method is not always convenient for use, as it requires the texture itself to be adjusted.

You won’t be able to reflect the animation of the wipers; you will have to manually move the bones (Bone Objects) and get them animated again.

If there is an object in the cabin for determining the position of the driver’s head (headPosition sphere), it also needs to be moved, and the pivot should be reset to the center of coordinates.
Work with the interior model is completed, save the model under the name saloon_r and export it along the same path as the interior for the left-side version.

Similar actions need to be done in the model displayed in the third-person view. Open CarLod0 and find the salon object (in this example, saloon_l). We make a duplicate of this object, naming it saloon_r, and apply the Mirror modifier to it.

Thus, there will be two salons in the scene: saloon_l for the left-hand drive version of the car (indicated in green in the screenshot) and saloon_r for right-hand drive (indicated in red in the screenshot):

2. Configuration File Refinement
In the CarProperty.ini file located in the folder data\gamedata\cars\<My_car_name>, where <My_car_name> is the name of your car, the values of some parameters are now divided into left and right versions of cars.
  • Accessibility of left and right versions:
[saloonDetail] carIsLeftSaloon = true // The left-side version is accessible (false – if it should not be so) carIsRightSaloon = true // The right-side version is accessible (false – if it should not be so)
  • Third-person interior view:
[bodyDetail] saloonLeftName = "saloon_l" // The name of the left-side part in the scene СarLod0 saloonRightName = "saloon_r" // The name of the right-side part in the scene СarLod0
  • First-person interior view:
[bodyDetail] saloonName = "saloon" // The name of the left-hand interior model saloonName = "saloon_r" // The name of the right-hand interior model
  • Driver’s location in the player’s car:
[Humans] DriverAnimated = (Shift = 0.0;0.0;0.0, Angle=0., Saloon="left") // The driver model offset relative to its location in the left-hand model DriverAnimated = (Shift = 0.0;0.0;0.0, Angle=0., Saloon="right") // The driver model offset relative to its location in the right-hand model
  • Model of driver and steering wheel for player’s car:
[Humans] DriverAnimatedModel = (Driver="cars/CarXX/driver", Wheel="cars/CarXX/wheel", Saloon="left") // Name of the driver and steering wheel models for the left-hand drive version, and their path relative to the Cars folder DriverAnimatedModel = (Driver="cars/CarXX/driver", Wheel="cars/CarXX/wheel_r", Saloon="right") // Name of the driver and steering wheel models for the right-hand drive version, and their path relative to the Cars folder
  • Tablet settings for VR:
[HMDRightHand] TabletModel = "cars/common/tablet_01_right" // Name of the tablet model for the right-hand drive version and its path relative to the cars folder TabletPosition = -0.0012; 0.0766; -0.648 // Tablet position (Local Coordinate System [-X; Z; Y]) TabletLookAt = 0; 0; -1 // Tablet rotation direction vector
  • Camera settings support:
[Cameras] CameraVariation_LeftHand="" // Camera parameter for the left-hand version interior CameraVariation_RightHand="RightHand" // Camera parameter for the right-hand version interior
3. Visualization Refinement
In the cameras.xml file located in the data\gamedata\cars\<My_car_name> folder, where <My_car_name> is the name of your car.

Example:



For rear view mirrors, settings are also added to the viewports.xml file located in the data\gamedata\cars\<My_car_name> folder.

Example:

1 Comments
Bad Karma 5 Feb, 2021 @ 4:53pm 
Is it the same has left hand drive like change "RightHand to"LeftHand"?