Changes between Initial Version and Version 1 of CarVisuals


Ignore:
Timestamp:
2011-09-17 12:32:32 (10 years ago)
Author:
edy
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • CarVisuals

    v1 v1  
     1{{{ #!Markdown 
     2 
     3# CarVisuals 
     4 
     5Provides the visual effects for the wheels, including suspension, rotation, steering, skidmarks and smoke.  
     6 
     7This is script is added at the root GameObject for the vehicle, together with the [CarControl](wiki:CarControl) script. The script needs a global __Skidmarks__ object to be present at the scene. Use the Skidmarks prefab from the Prebafs folder. The Skidmarks object has a child object __SkidSmoke__ which provides the particle emitter and renderer for the smoke effects. 
     8 
     9#### PivotFL, PivotFR, PivotRL, PivotRR 
     10 
     11References to the pivot GameObjects for each wheel. 
     12 
     13Each __pivot__ GameObject is located at the vehicle's local position for each wheel. Pivots will be moved vertically (suspension) and the front ones will be rotated around their local Y axis (steering). These GameObjects are the proper placeholders for _disc brake_ meshes, which doesn't rotate with the wheel but respond to suspension and steering (example: Sport Coupe). If no disc brakes are used in the model, then use empty GameObjects (example: Bus). 
     14 
     15#### MeshFL, MeshFR, MeshRL, MeshRR 
     16 
     17References to the GameObjects representing each wheel and tire. These are the 3D meshes for the wheels. 
     18 
     19These GameObjects must be child of their respective pivots. They will be rotated around X axis as the normal wheel rotation when the vehicle moves. 
     20 
     21#### Steering wheel 
     22 
     23A reference to the GameObject containing the steering wheel, if available. It must be properly located and orientated at the proper position. The GameObject will be rotated around its local Z axis according to current steering angle. The maximum angle for the steering wheel is configured at the property steeringWheelMax. 
     24 
     25#### Ignored colliders 
     26 
     27This parameter is necessary when the vehicle's rigidbody is configured to use interpolation (_RigidBody > Interpolate_). In that case, add here any collider of the vehicle that overlaps or is close to the WheelCollider objects. This is neccesary because the interpolation could interfere with the Raycasts used for determining the wheel's vertical position, so strange visual effects can occur if the colliders are not ignored. 
     28 
     29## Skidmarks parameters 
     30 
     31These values are defined in terms of the __tire's skid ratio__: 
     32 
     33- __0 .. 1.0__: tire is not skidding, it's conserving all its grip. 1.0 means the slip value at which the tire performs the maximum grip. 
     34- __1.0 .. 2.0__: tire is beginning to loose its grip as consequence of the increasing slip. 2.0 means the slip value at which the tire reaches its minimum grip and is heavily skidding. 
     35- __> 2.0__: tire is heavily skidding at its minimum grip value. The slip value in m/s that has surpassed the point of minimum force is this value minus 2.0. Example: a relative skid ratio of 4.0 means the tire is skidding at the slip value of minimum grip + 2 m/s. 
     36 
     37The relative skid ratio can be seen in real time in the Telemetry values FSR and SSR for each wheel (key B at the [Live Demo][1]). The Friction line shows the slip values for maximum and minimum grip, for both forward (F) and sideways (S) curves. 
     38 
     39__forwardSkidmarksBegin__: skid ratio where the skidmark begins to appear as consequence of accelerating / braking. 
     40 
     41__forwardSkidmarksRange__: range of skid ratio where the skidmark increases its intensity progressively according to the forward slip (accelerate / brake). 
     42 
     43__sidewaysSkidmarksBegin__: skid ratio where the skidmark begins to appear as consequence of sideways slip (drifting). 
     44 
     45__sidewayskidmarksRange__: range of skid ratio where the skidmark increases its intensity progressively according to the sideways slip (drift). 
     46 
     47__skidmarksWidth__ (m): use for match the skidmarks' width with the wheel's width. 
     48 
     49__skidmarksOffset__ (m): use for properly align the skidmarks with the wheels. 
     50 
     51#### Skidmarks example: 
     52 
     53    Telemetry:  
     54        WheelFL RPM:   0 S: 0.50 F: 6007 FS:-1.50 SS: 0.94 FSR:-1.00 SSR: 0.27 
     55        Friction F: [1.500, 2.500] S: [3.500, 6.000] 
     56 
     57The _forwards skid ratio_ (FSR) is 1.0 when the _forward slip_ (FS) is 1.500 m/s, and is 2.0 when the slip is 2.500 m/s. The further slip values in m/s are directly added to the the ratio. For example, if the forward slip value is 7 m/s, the skid ratio results in 2.0 + (7 - 2.500) = 6.5, which means "4.5 m/s above the slip value where the skid ratio is 2.0 (2.500 m/s)". 
     58 
     59    forwardSkidmarksBegin = 1.5 
     60    forwardSkidmarksRange = 5.0 
     61 
     62Skidmarks will start appearing when the forward slip (FS, accelerate / brake) is __2 m/s__ (forwardSkidmarksBegin = 1.5 = half way between 1.500 and 2.500). The skidmarks appear at their maximum intensity at the skid ratio forwardSkidmarksBegin+forwardSkidmarksRange = 1.5 + 5.0 = 6.5. This skid ratio means 4.5 m/s above the slip value corresponding to the ratio 2.0. So the slip for the maximum intensity is 4.5 + 2.500 = __7 m/s__. 
     63 
     64## Smoke parameters 
     65 
     66These values are also defined as __skid ratio__ (see above): 
     67 
     68__forwardSmokeBegin__: minimum skid ratio where the smoke can start appearing as consequence of forward slip (burnouts, brake lock) 
     69 
     70__forwardSmokeRange__: range of forward skid ratio where the smoke increases its intensity progressively. 
     71 
     72__sidewaysSmokeBegin__: minimum skid ratio where the smoke can start appearing as consequence of sideways slip (drifting). 
     73 
     74__sidewaysSmokeRange__: range of sideways skid ratio where the smoke increases its intensity propgressively. 
     75 
     76The smoke is also controlled by the time that the tire's slip is inside the smoke range. When the tire's skid ratio reaches the SmokeBegin value, time starts counting forward. When the skid ratio decreases below the SmokeBegin value, time counts reverse. This allows to control the smoke's intensity according to the time and frequency the wheel enters into the "smoke zone". It's like a kind of tire's temperature, but just counting the heating-cooling time instead of degrees. 
     77 
     78__smokeStartTime__: time in seconds that the tire must be in the smoke's skid range in order to begin emitting smoke. 0 means that the smoke starts as soon as the tire's reaches the SmokeBegin value. 
     79 
     80__smokePeakTime__: time in seconds the tire takes to reach the maximum smoke intensity. 
     81 
     82__smokeMaxTime__: maximum time that is counted while the tire's skid ratio is over SmokeBegin. Note that this value could be smaller than smokePeakTime, so the smoke never reaches the maximum intensity. 
     83 
     84#### Smoke example: 
     85 
     86    smokeStartTime = 2 
     87    smokePeakTime = 12 
     88    smokeMaxTime = 24 
     89 
     90Provided that the tire is performing a continuous burnout, then: 
     91 
     92- 2 seconds after starting the burnout the tire starts emitting very small traces of smoke, which begin growing progressively. 
     93- 10 seconds later (at second 12) the tire is generating smoke at maximum intensity. 
     94- The burnout continues during at least other 12 seconds (total seconds: 24 or more), maximum smoke intensity. 
     95 
     96When the burnout ends the time will count reverse:  
     97 
     98- The tire will take 12 seconds to "start cooling". During those 12 seconds, if the burnout restarts the smoke will already begin at its maximum intensity. 
     99- The next 10 seconds, the tire will be "cooling" progressively. If the burnout restarts, the smoke will begin at the corresponding intensity. 
     100- The next 2 seconds the tire won't emit smoke if the burnout restarts, just the time will count forward. 
     101 
     102## Other settings 
     103 
     104__wheelGroundedBias__: distance in meters the wheels are placed intersecting the ground. This simulates the deformation as consequence of the vehicle's weight. 
     105 
     106__steeringWheelMax__: maximum rotation degrees the steering wheel can rotate in each direction. Used for moving the steering wheel according to the user's input. 
     107 
     108 
     109 
     110 
     111 
     112[1]: http://www.edy.es/unity/offroader.html 
     113 
     114}}}