{"id":1493,"date":"2015-08-28T19:55:16","date_gmt":"2015-08-28T17:55:16","guid":{"rendered":"http:\/\/www.edy.es\/dev\/?p=1493"},"modified":"2017-02-16T10:51:04","modified_gmt":"2017-02-16T09:51:04","slug":"vehicle-physics-pro-latest-updates","status":"publish","type":"post","link":"https:\/\/www.edy.es\/dev\/2015\/08\/vehicle-physics-pro-latest-updates\/","title":{"rendered":"Vehicle Physics Pro latest updates"},"content":{"rendered":"<p>After having dedicated some time to <a href=\"http:\/\/u3d.as\/1Ba\">Edy&#8217;s Vehicle Physics<\/a> (with great results!), I&#8217;m now giving a push to <a href=\"http:\/\/vehiclephysics.com\">Vehicle Physics Pro<\/a>. <em>Early Access<\/em> licensees, this is of interest to you!<\/p>\n<p>I&#8217;ve committed several updates\u00a0these days:<\/p>\n<h3>Gravity hack removed<\/h3>\n<p>You should now remove all VPGravity components\u00a0from your scenes (you&#8217;ll see an Unity error otherwise) and configure gravity normally in the project. The VPGravity script is now a static class for managing gravity in vehicles. It also caches some extensively used values, such as the magnitude and the Up direction.<\/p>\n<p><a href=\"https:\/\/www.edy.es\/dev\/wp-content\/uploads\/2015\/08\/VPP-gravity-hack-removed-2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-1498 \" src=\"https:\/\/www.edy.es\/dev\/wp-content\/uploads\/2015\/08\/VPP-gravity-hack-removed-2.png\" alt=\"VPP-gravity-hack-removed-2\" width=\"450\" height=\"66\" srcset=\"https:\/\/www.edy.es\/dev\/wp-content\/uploads\/2015\/08\/VPP-gravity-hack-removed-2.png 600w, https:\/\/www.edy.es\/dev\/wp-content\/uploads\/2015\/08\/VPP-gravity-hack-removed-2-300x44.png 300w\" sizes=\"auto, (max-width: 450px) 100vw, 450px\" \/><\/a><\/p>\n<p>VPP in Unity 5 was using a hack for ensuring the WheelCollider\u00a0suspension to work correctly. This hack consisted in setting global gravity to zero, then manually imposing the gravity via Rigidbody.AddForce. Now I&#8217;m using a different approach that doesn&#8217;t require this hack anymore. Now the suspension force is not applied in a strictly correct way\u00a0(will be in Unity 3D 5.2+), but this change is barely noticeable.<\/p>\n<h3>Any gravity direction and magnitude is now supported<\/h3>\n<h3><a href=\"https:\/\/www.edy.es\/dev\/wp-content\/uploads\/2015\/08\/VPP-gravity-direction-marked.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter  wp-image-1504\" src=\"https:\/\/www.edy.es\/dev\/wp-content\/uploads\/2015\/08\/VPP-gravity-direction-marked-300x188.png\" alt=\"VPP-gravity-direction-marked\" width=\"440\" height=\"276\" srcset=\"https:\/\/www.edy.es\/dev\/wp-content\/uploads\/2015\/08\/VPP-gravity-direction-marked-300x188.png 300w, https:\/\/www.edy.es\/dev\/wp-content\/uploads\/2015\/08\/VPP-gravity-direction-marked-1024x640.png 1024w, https:\/\/www.edy.es\/dev\/wp-content\/uploads\/2015\/08\/VPP-gravity-direction-marked.png 1222w\" sizes=\"auto, (max-width: 440px) 100vw, 440px\" \/><\/a><\/h3>\n<p>VPP now supports the gravity to be in any direction and magnitude. The only requirement is either modifying the global gravity using\u00a0<em>VPGravity.value<\/em>, or calling <em>VPGravity.Refresh()<\/em> after modifying <em>Physics.gravity<\/em> yourself. As a static class, you can invoke VPGravity\u00a0properties and methods anywhere in your code.<\/p>\n<h3>New <em>sleep mode<\/em>\u00a0for the wheels<\/h3>\n<p><a href=\"https:\/\/www.edy.es\/dev\/wp-content\/uploads\/2015\/08\/VPP-handbrake-hill-steady-marked.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter  wp-image-1496\" src=\"https:\/\/www.edy.es\/dev\/wp-content\/uploads\/2015\/08\/VPP-handbrake-hill-steady-marked-300x188.png\" alt=\"VPP-handbrake-hill-steady-marked\" width=\"440\" height=\"276\" srcset=\"https:\/\/www.edy.es\/dev\/wp-content\/uploads\/2015\/08\/VPP-handbrake-hill-steady-marked-300x188.png 300w, https:\/\/www.edy.es\/dev\/wp-content\/uploads\/2015\/08\/VPP-handbrake-hill-steady-marked-1024x640.png 1024w, https:\/\/www.edy.es\/dev\/wp-content\/uploads\/2015\/08\/VPP-handbrake-hill-steady-marked.png 1222w\" sizes=\"auto, (max-width: 440px) 100vw, 440px\" \/><\/a><\/p>\n<p>This improvement\u00a0keeps the vehicle completely steady when parked on hills or slopes, even when only some wheels are braked or another object is pushing it. The typical situation is the vehicle being parked on a slope with handbrake applied only, as seen in the above pic: only the rear wheels are braked and applying force, yet the vehicle is perfectly steady at the slope.<\/p>\n<h3>New parameter for tweaking the wheel simulation model<\/h3>\n<p>A new parameter <strong><em>tireImpulseRatio<\/em><\/strong> configures the magnitude of the force that keeps the tire adherent. Previously VPP used\u00a0a hard-coded\u00a0value of 0.5, which worked in most vehicles.<\/p>\n<p>Lower this parameter if the tire forces get numerically unstable when the vehicle is resting or under external loads. Ideally, the best value for this ratio is the higher value where the tire forces are stable. These forces tend to become unstable at vehicles with raised\u00a0center of mass, and\/or supporting external loads. In most cases you can leave the default 0.5.<\/p>\n<h3>What&#8217;s next<\/h3>\n<p>Next immediate step is fixing a known bug related to clutch torque and integration substeps. I think this is a priority as it\u00a0might involve significant adjustments in other components that calculate progressive torque ratios such as the automatic gearbox and the torque splitter.<\/p>\n<h4>Things to do before entering the Beta:<\/h4>\n<ul>\n<li>Refactor\u00a0the code for using namespaces instead of &#8220;VP&#8221; prefixes.<\/li>\n<li>Prepare the 3D assets for deploying. They all should be in FBX format. The repository should include a &#8220;source&#8221; folder with the original Blender files.<\/li>\n<\/ul>\n<p>Vehicle Physics Pro is in alpha stage, but <a href=\"http:\/\/vehiclephysics.com\/#licensing\">I&#8217;m offering Early Access to the development repositories<\/a>. Mail me to <a href=\"mailto:edytado@gmail.com\">edytado@gmail.com<\/a> if you&#8217;re interested.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>After having dedicated some time to Edy&#8217;s Vehicle Physics (with great results!), I&#8217;m now giving a push to Vehicle Physics Pro. Early Access licensees, this is of interest to you! I&#8217;ve committed several updates\u00a0these days: Gravity hack removed You should now remove all VPGravity components\u00a0from your scenes (you&#8217;ll see an Unity error otherwise) and configure [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1501,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":true,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"Vehicle Physics Pro latest updates","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[11,17,4,5],"tags":[],"class_list":["post-1493","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog","category-slideshow","category-unity","category-vehicle-physics"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/www.edy.es\/dev\/wp-content\/uploads\/2015\/08\/VPP-handbrake-hill-steady_cr.png","jetpack_shortlink":"https:\/\/wp.me\/p1PjRF-o5","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.edy.es\/dev\/wp-json\/wp\/v2\/posts\/1493","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.edy.es\/dev\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.edy.es\/dev\/wp-json\/wp\/v2\/types\/post"}],"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=1493"}],"version-history":[{"count":7,"href":"https:\/\/www.edy.es\/dev\/wp-json\/wp\/v2\/posts\/1493\/revisions"}],"predecessor-version":[{"id":1506,"href":"https:\/\/www.edy.es\/dev\/wp-json\/wp\/v2\/posts\/1493\/revisions\/1506"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.edy.es\/dev\/wp-json\/wp\/v2\/media\/1501"}],"wp:attachment":[{"href":"https:\/\/www.edy.es\/dev\/wp-json\/wp\/v2\/media?parent=1493"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.edy.es\/dev\/wp-json\/wp\/v2\/categories?post=1493"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.edy.es\/dev\/wp-json\/wp\/v2\/tags?post=1493"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}