{"id":1369,"date":"2015-04-01T04:34:10","date_gmt":"2015-04-01T02:34:10","guid":{"rendered":"http:\/\/www.edy.es\/dev\/?page_id=1369"},"modified":"2024-02-12T15:42:29","modified_gmt":"2024-02-12T14:42:29","slug":"user-guide","status":"publish","type":"page","link":"https:\/\/www.edy.es\/dev\/vehicle-physics\/user-guide\/","title":{"rendered":"Edy&#8217;s Vehicle Physics &#8211; User Guide"},"content":{"rendered":"<div class=\"menu-edys-vehicle-physics-container\"><ul id=\"short_menu_69ef6f9ca3f70\" class=\"shortcode_menu pagemenu wpsm-menu enhance_shortcode_menu_inline  \"><li id=\"menu-item-1335\" class=\"menu-item menu-item-type-post_type menu-item-object-page menu-item-1335\"><a href=\"https:\/\/www.edy.es\/dev\/vehicle-physics\/\">Home<\/a><\/li>\n<li id=\"menu-item-1338\" class=\"menu-item menu-item-type-post_type menu-item-object-page menu-item-1338\"><a href=\"https:\/\/www.edy.es\/dev\/vehicle-physics\/features\/\">Features<\/a><\/li>\n<li id=\"menu-item-1412\" class=\"menu-item menu-item-type-post_type menu-item-object-page menu-item-1412\"><a href=\"https:\/\/www.edy.es\/dev\/vehicle-physics\/demo\/\">Demo<\/a><\/li>\n<li id=\"menu-item-1384\" class=\"menu-item menu-item-type-post_type menu-item-object-page menu-item-1384\"><a href=\"https:\/\/www.edy.es\/dev\/vehicle-physics\/user-guide\/\">User Guide<\/a><\/li>\n<li id=\"menu-item-1336\" class=\"menu-item menu-item-type-post_type menu-item-object-page menu-item-1336\"><a href=\"https:\/\/www.edy.es\/dev\/vehicle-physics\/upgrade-notes\/\">Upgrade notes<\/a><\/li>\n<\/ul><\/div><div class=\"clear\"><\/div>\n\t\t\t<style>\n\t\t\t\t#short_menu_69ef6f9ca3f70 {  }\n\t\t\t\t#short_menu_69ef6f9ca3f70 ul.wpsm-arrow-enabled:before {  } \n\t\t\t\t#short_menu_69ef6f9ca3f70 ul, #short_menu_69ef6f9ca3f70 ul ul {  }\n\t\t\t\t#short_menu_69ef6f9ca3f70 a {  }\n\t\t\t\t#short_menu_69ef6f9ca3f70 a:hover {  }\n\t\t\t\t#short_menu_69ef6f9ca3f70 ul a {  }\n\t\t\t\t#short_menu_69ef6f9ca3f70 ul a:hover {  }\n\t\t\t\t\n\t\t\t<\/style>\n\t\t\t<script type=\"text\/javascript\">\n\t\t\t\tvar show_arrow = \"true\";var $sm = jQuery.noConflict();\n\t\t\t\t\tjQuery(function ($) {\n\t\t\t\t\t\t$(\"#short_menu_69ef6f9ca3f70\").tinyNav();\n\t\t\t\t\t\t$(\"#short_menu_69ef6f9ca3f70\").next().addClass(\"shortcode-menu-mobile\");\n\t\t\t\t\t\t\n\t\t\t\t\t\tshortcode_menu_responsive();\n\t\t\t\t\t});\n\t\t\t\t\tjQuery(window).resize(function($){\n\t\t\t\t\t\tshortcode_menu_responsive();\n\t\t\t\t\t});\n\t\t\t\t\tfunction shortcode_menu_responsive()\n\t\t\t\t\t{\n\t\t\t\t\t\tvar window_width = $sm(window).width();\n\t\t\t\t\t\tif(window_width <= 650)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$sm(\"#short_menu_69ef6f9ca3f70\").hide();\n\t\t\t\t\t\t\t$sm(\"#short_menu_69ef6f9ca3f70\").next().show();\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$sm(\"#short_menu_69ef6f9ca3f70\").show();\n\t\t\t\t\t\t\t$sm(\"#short_menu_69ef6f9ca3f70\").next().hide();\n\t\t\t\t\t\t}\n\t\t\t\t\t}<\/script>\n<h2>User Guide for Edy&#8217;s Vehicle Physics 5<\/h2>\n<p>A brief description of the package to\u00a0help you to get started quickly.<\/p>\n<h4>Example scenes provided with the package:<\/h4>\n<ul>\n<li>\u201cThe City \u2013 Simple Scene\u201d: most simple setup with a single vehicle and the camera.<\/li>\n<li>\u201cThe City \u2013 Vehicle Manager\u201d: using\u00a0the Vehicle Manager component\u00a0for controlling several vehicles.<\/li>\n<\/ul>\n<p><a href=\"https:\/\/www.edy.es\/dev\/wp-content\/uploads\/2015\/04\/2015-04-01_043148.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-1382\" src=\"https:\/\/www.edy.es\/dev\/wp-content\/uploads\/2015\/04\/2015-04-01_043148-300x176.png\" alt=\"\" width=\"300\" height=\"176\" srcset=\"https:\/\/www.edy.es\/dev\/wp-content\/uploads\/2015\/04\/2015-04-01_043148-300x176.png 300w, https:\/\/www.edy.es\/dev\/wp-content\/uploads\/2015\/04\/2015-04-01_043148-1024x600.png 1024w, https:\/\/www.edy.es\/dev\/wp-content\/uploads\/2015\/04\/2015-04-01_043148.png 1136w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>Keys:<\/p>\n<table>\n<tbody>\n<tr>\n<td>WSAD or arrows<\/td>\n<td>Throttle, brake, steering<\/td>\n<\/tr>\n<tr>\n<td>Space<\/td>\n<td>Handbrake<\/td>\n<\/tr>\n<tr>\n<td>Enter<\/td>\n<td>Reset vehicle (e.g. if it rolls over)<\/td>\n<\/tr>\n<tr>\n<td>C<\/td>\n<td>Change camera<\/td>\n<\/tr>\n<tr>\n<td>Tab or Page Up \/ Page Down<\/td>\n<td>Select vehicle (Vehicle Manager scene)<\/td>\n<\/tr>\n<tr>\n<td>E<\/td>\n<td>Makes the gray stone to &#8220;jump&#8221;. Useful for load tests.<\/td>\n<\/tr>\n<tr>\n<td>R<\/td>\n<td>Repair vehicle damage<\/td>\n<\/tr>\n<tr>\n<td>T<\/td>\n<td>Slow time mode<\/td>\n<\/tr>\n<tr>\n<td>P<\/td>\n<td>Pause vehicles. Camera and vehicle selection works while in pause.<\/td>\n<\/tr>\n<tr>\n<td>Y<\/td>\n<td>Show\/Hide telemetry. Shift-Y changes telemetry mode.<\/td>\n<\/tr>\n<tr>\n<td>Esc<\/td>\n<td>Reset scene<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<hr \/>\n<h3>How to create a vehicle from scratch<\/h3>\n<p><span class=\"embed-youtube\" style=\"text-align:center; display: block;\"><iframe loading=\"lazy\" class=\"youtube-player\" width=\"586\" height=\"330\" src=\"https:\/\/www.youtube.com\/embed\/8stasJIfx6I?version=3&#038;rel=1&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;fs=1&#038;hl=en-US&#038;autohide=2&#038;wmode=transparent\" allowfullscreen=\"true\" style=\"border:0;\" sandbox=\"allow-scripts allow-same-origin allow-popups allow-presentation allow-popups-to-escape-sandbox\"><\/iframe><\/span><\/p>\n<hr \/>\n<h3>Component overview<\/h3>\n<p>Main components:<\/p>\n<ul>\n<li><strong>VehicleController<\/strong>: provides vehicle physics<\/li>\n<li><strong>VehicleCameraController<\/strong>: attach to a camera for providing all the camera modes<\/li>\n<li><strong>VehicleManager<\/strong>: manages\u00a0several user-controlled vehicles in the scene<\/li>\n<li><strong>GroundMaterialManager<\/strong>: easily manages all the ground materials and their properties<\/li>\n<\/ul>\n<p>Vehicle add-on components:<\/p>\n<ul>\n<li><strong>VehicleAudio<\/strong>: provides\u00a0all audio effects<\/li>\n<li><strong>VehicleDamage<\/strong>: vehicle deformation and deterioration of handling<\/li>\n<li><strong>VehicleRandomInput<\/strong>: example script on how to implement a simple AI<\/li>\n<li><strong>VehicleStandardInput*<\/strong>: reads the standard Unity Input\u00a0for controlling the vehicle<\/li>\n<li><strong>VehicleTelemetry*<\/strong>: UI and gizmos that expose the internal physic values for developers<\/li>\n<li><strong>VehicleTireEffects<\/strong>: provides tire marks, smoke, etc using the information from GroundMaterialManager<\/li>\n<li><strong>VehicleViewConfig<\/strong>: visual information to be used by VehicleCameraController when targeting the vehicle<\/li>\n<\/ul>\n<p style=\"padding-left: 30px;\"><em>* VehicleStandardInput and VehicleTelemetry may be added to the VehicleManager game object instead, so all the managed vehicles use the same input and telemetry settings.<\/em><\/p>\n<p>Additional components:<\/p>\n<ul>\n<li><strong>TireMarksRenderer<\/strong>: draws the tire marks on a specific ground material<\/li>\n<li><strong>TireParticleEmitter<\/strong>: provides particle effects such as smoke and dust on a specific ground material<\/li>\n<li><strong>RigidbodyPause<\/strong>: allows the vehicles with this component to be paused and resumed<\/li>\n<li><strong>VehicleNitro<\/strong>: applies a sudden impulse or acceleration to the vehicle<\/li>\n<li><strong>SceneTools<\/strong>: generic functions such as slow-time mode and application quit on Escape<\/li>\n<\/ul>\n<hr \/>\n<h3>Vehicle Controller<\/h3>\n<h4>Wheels<\/h4>\n<p>Reference all the vehicle&#8217;s WheelCollider components\u00a0here. Also, define the role(s) for each one (steer, drive, brake, handbrake).<\/p>\n<p>A transform can be provided to be used as visual mesh for the wheel.<\/p>\n<h4>Handling &amp; Behavior<\/h4>\n<p>These settings define most of the vehicle&#8217;s behavior.<\/p>\n<p><strong>Center of Mass (CoM):<\/strong> Position of the center of mass (CoM) for the rigidbody. If it&#8217;s omitted then it will be calculated out of the colliders.\u00a0Combine the height of the CoM with the Anti Roll setting for configuring the vehicle&#8217;s reactions to the different accelerations (throttle, brake, steering).<\/p>\n<p><strong>Tire Friction:<\/strong> coefficient of friction of the wheels. 1 is the standard. More for sport vehicles, less\u00a0for family vehicles, trucks, etc. This value affects the maximum acceleration of the vehicle.<\/p>\n<p><strong>Anti-Roll:<\/strong> controls the sideways banking. With 0 the banking is defined by the height of the CoM. If 1 the vehicle will steer almost flat.<\/p>\n<p><strong>Max Steer Angle:<\/strong> for the steering wheels, in degrees.<\/p>\n<p><strong>Aero Drag:<\/strong> drag force coefficient with speed. Force applied is <em>coefficient\u00a0* speed^2<\/em>. Drag reduces the effective maximum speed of the vehicle.<\/p>\n<p><strong>Aero Downforce:<\/strong> force pushing the vehicle down with speed. Force applied is <em>coefficient\u00a0* speed^2<\/em>. The\u00a0downforce applies more load on the wheels, increasing their\u00a0grip.<\/p>\n<p><strong>Aero App Point Offset:<\/strong> longitudinal distance in meters from the CoM where the aero forces will be applied.<\/p>\n<p style=\"padding-left: 30px;\"><strong>Aerodynamic properties<\/strong> are applied in a point relative to the CoM given by the property AeroAppForceOffset, in meters. If set to 0 then the drag and downforce will be applied at the CoM. A positive value means applying them ahead of the CoM. A negative value means applying the forces behind the CoM. The property AeroDownforce pushes the vehicle down with the speed, giving the wheels more grip. If AeroAppForceOffset is negative, then the rear wheels receive more extra grip than front wheels. This is useful for achieving stability at high speeds. The opposite also applies: if the vehicle can hardly turn at high speed, then you could try setting AeroAppForceOffset to a positive value (eg. 0.5, 1.0).<\/p>\n<h4>Motor<\/h4>\n<p><strong>Max Speed Forward,<\/strong><br \/>\n<strong>Max Speed Reverse:<\/strong> maximum speed of the vehicle in m\/s for each direction. Drive force is decreased with speed according to the Force Curve Shape. Beyond the maximum speed a resistive force\u00a0is generated.<\/p>\n<p><strong>Max Drive Force:<\/strong>\u00a0Maximum force in Newtons (N) that is delivered to the wheels at full throttle. Effective maximum force is decreased with speed according to the Force Curve Shape. Final force applied by wheels depend on the Tire Friction and load.<\/p>\n<p><strong>Max Drive Slip:<\/strong> maximum slip in m\/s the wheel is allowed to slide over the surface while it&#8217;s receiving drive force. When the wheel is sliding the force is deflected to the slide direction, and the wheel loose sideways grip. The more slip allowed, less sideways grip. Traction Control (TC) limits this slip or even removes it.<\/p>\n<p><strong>Drive Force To Max Slip:<\/strong>\u00a0Excess of throttle force in N that makes\u00a0the wheel to slip at Max Drive Slip rate.<\/p>\n<p style=\"padding-left: 30px;\"><em><strong>Force and slip example<\/strong><\/em>:<br \/>\nmaxDriveForce is 3000N;<br \/>\ndriveForceToMaxSlip is 1000N;<br \/>\nmaxDriveSlip is 5 m\/s;<br \/>\nThe\u00a0actual tire force at\u00a0the wheel (load * tireFriction) is\u00a02500N. Applying full throttle\u00a0means an excess of 3000-2500 = 500N. This is the half of driveForceToMaxSlip, so the wheel is allowed to slip the half of maxDriveSlip, that is, 2.5 m\/s.<\/p>\n<p><strong>Force Curve Shape:<\/strong> How the force is decreased with speed. Affects the\u00a0time the vehicle needs for reaching its maximum speed. Realistic forces have values &lt; 0.5. Arcade-style forces use values &gt; 0.5.<\/p>\n<h4>Brakes<\/h4>\n<p><strong>Max Brake Force:<\/strong>\u00a0Maximum force in Newtons (N) that is delivered to the brakes at full brake input.\u00a0Final brake force applied by the wheels depend on the Tire Friction and load.<\/p>\n<p><strong>Brake Force To Max Slip:<\/strong>\u00a0Excess of force in N that makes\u00a0the wheel to slip while braking at its\u00a0maximum allowed rate (defined below) when receiving brake force.<\/p>\n<p><strong>Brake Mode,<br \/>\n<\/strong><strong>Hand Brake Mode:<\/strong>\u00a0how the excess of brake force will be translated into slip.<\/p>\n<ul>\n<li><strong>Slip:<\/strong> a maximum slip in m\/s is allowed when braking. Example: if maxBrakeSlip is 2 the wheel won&#8217;t slide further than 2 m\/s, even applying a\u00a0huge brake force. This setting allows controlling the reaction of the brakes when\u00a0braking at any speed.<\/li>\n<li><strong>Ratio:<\/strong> the maximum slip when braking is a\u00a0ratio of the actual\u00a0speed. Example: if maxBrakeRatio is 1, appling full brakes will actually lock the wheel. This is a more realistic setting.<\/li>\n<\/ul>\n<p><strong>Max Brake Slip,<br \/>\nMax Handbrake Slip:<\/strong>\u00a0maximum slip\u00a0in m\/s allowed\u00a0in\u00a0the Slip brake mode.<\/p>\n<p><strong>Max Brake Ratio,<br \/>\nMax Handbrake Ratio:<\/strong> maximum slip ratio in % (0-1) of the actual speed allowed in the Ratio brake mode.<\/p>\n<h4>Driving Aids<\/h4>\n<p>Each driving aid can be configured gradually from disabled to fully engaged.<\/p>\n<p><strong>TC:<\/strong>\u00a0Do not allow wheels to slide when applying throttle.<\/p>\n<p><strong>ABS:<\/strong> Do not allow wheels to slide when applying brakes.<\/p>\n<p><strong>ESP:<\/strong> Limits the steering angle with speed.<\/p>\n<h4>Vehicle Controls<\/h4>\n<p>Just the\u00a0exposed controls of the vehicle&#8217;s user input.\u00a0Useful in some circumstances while developing in the Editor. Most of time these will be controlled by the component Vehicle Standard Input.<\/p>\n<h4>Visual wheels<\/h4>\n<p>Settings affecting the visual meshes of the wheels. Can be configured for visual quality or performance:<\/p>\n<p><strong>Spin Update Rate:<\/strong> when to update the wheel&#8217;s rotation. <em>OnUpdate<\/em> provides great quality even in slow motion, <em>OnFixedUpdate<\/em> is slightly faster.<\/p>\n<p><strong>WheelPositionMode:<\/strong> how to calculate the visual wheel contacting the ground. <em>Accurate<\/em> uses an additional RayCast on each frame. <em>Fast<\/em>\u00a0takes the position reported by the physics directly.<\/p>\n<h4>Optimization<\/h4>\n<p><strong>Disallow Runtime Changes:<\/strong>\u00a0Performance optimization if these WheelCollider parameters are not expected to change at runtime: spring, damper, suspension distance, force application point).<\/p>\n<hr \/>\n<h3>Wheel Collider<\/h3>\n<p>These properties must be configured in the WheelCollider:<\/p>\n<ul>\n<li>Radius (m)<\/li>\n<li>Suspension Distance (m)<\/li>\n<li>Spring (N\/m)<\/li>\n<li>Damper (Ns\/m)<\/li>\n<\/ul>\n<p>Position and Radius can be automatically configured\u00a0to their corresponding visual meshes. Set the Wheels properties\u00a0in Vehicle Controller (Wheel Collider + Wheel Transform), then click the context menu for the component\u00a0and select <strong>Adjust WheelColliders to their meshes<\/strong>. Check out the\u00a0video at the top of the page.<\/p>\n<p>These properties may be configured optionally:<\/p>\n<ul>\n<li>Force App Point Distance (m) (not important)<\/li>\n<li>Center (optional)<\/li>\n<\/ul>\n<p>All other properties are either not used or handled internally\u00a0by Edy&#8217;s Vehicle Physics 5. No need to\u00a0set them in the editor, as their values don&#8217;t have any effect in the simulation.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>User Guide for Edy&#8217;s Vehicle Physics 5 A brief description of the package to\u00a0help you to get started quickly. Example scenes provided with the package: \u201cThe City \u2013 Simple Scene\u201d: most simple setup with a single vehicle and the camera. \u201cThe City \u2013 Vehicle Manager\u201d: using\u00a0the Vehicle Manager component\u00a0for controlling several vehicles. Keys: WSAD or [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":5,"menu_order":0,"comment_status":"open","ping_status":"closed","template":"page-c.php","meta":{"jetpack_post_was_ever_published":false,"footnotes":""},"class_list":["post-1369","page","type-page","status-publish","hentry"],"jetpack_shortlink":"https:\/\/wp.me\/P1PjRF-m5","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.edy.es\/dev\/wp-json\/wp\/v2\/pages\/1369","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.edy.es\/dev\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.edy.es\/dev\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.edy.es\/dev\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.edy.es\/dev\/wp-json\/wp\/v2\/comments?post=1369"}],"version-history":[{"count":21,"href":"https:\/\/www.edy.es\/dev\/wp-json\/wp\/v2\/pages\/1369\/revisions"}],"predecessor-version":[{"id":2031,"href":"https:\/\/www.edy.es\/dev\/wp-json\/wp\/v2\/pages\/1369\/revisions\/2031"}],"up":[{"embeddable":true,"href":"https:\/\/www.edy.es\/dev\/wp-json\/wp\/v2\/pages\/5"}],"wp:attachment":[{"href":"https:\/\/www.edy.es\/dev\/wp-json\/wp\/v2\/media?parent=1369"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}