纳金网

标题: 如何使用unity3d制作出真实的物理效果(一) [打印本页]

作者: 会飞的鱼    时间: 2011-11-12 11:29
标题: 如何使用unity3d制作出真实的物理效果(一)




           先看demo:
           

           Demo:
           


            http://www.edy.es/unity/Offroader.html/
           







           Press Enter to restart the level (i.e. if you flip the car or fall outside the terrain)
         

           Press C to change the secondary camera.
           

           Press B to change the stability mode among "Sport / Offroad" (default is "Sport")
           

           Press N to disable all stability features (keeps the plain rigidbody + 4 wheel colliders only). B to reenable.
         

           It's not only a typical road-car not meant to being too stable, but it also carries a heavy 500 Kg (1100 lbs) box! Can you keep it safely with you in all kind of terrains?
         

           Notes:
           

           - Simple PhysX model: rigidbody + some box colliders roughly resembling the car's shape + 4 standard WheelColliders
           

           - REAL center of mass, located around the front seats.
           

           - No angular drag, no arbitrary forces.
           

           - Default tyre friction curves, only stiffness is adjusted (forward: 0.82, sideways: 0.022)
           

           - No parameter is modified at***ntime! (center of mass, rigidbody, drag or angular drag, suspension...)
         

           ---------------------------------------------------------------------------------------------------
         

           This is the typical stability problem when using WheelColliders:
         

           Q: Why my absolutely simple car (rigidbody + 4 wheel colliders) flips over so easily when steering?
           

           A: Because that's exactly how such car would behave in real life!!
         

           So you have created a box, added a rigidbody and four wheel colliders. Maybe you've even used some real car's data (mass, dimensions...). You have added a control script, tested it, and as soon as you gain a bit of speed and do a corner, the car rolls and flips over.
         

           If you could build that in real life, it would do the same! PhysX is not perfect, but resembles the physical behavior of real objects in a fairly good manner.
         

           Also note that the default WheelCollider's friction curve parameters in Unity (1,20000,2,10000,1) define a tyre with almost infinite grip. So the rigidbody has no choice but rolling-over when steering even at low speed. You should first set the last parameter (Stiffness Factor) to 0.01-0.03 to have more realistic tyres, but even in that case the car will roll over when stering at certain (low) speed.
         

           Q: But real cars don't roll over so easily. Why?
           

           A: Because real cars have STABILIZER BARS (aka anti-roll or anti-sway bars)
         


            http://auto.howstuffworks.com/question432.htm
           


作者: 晃晃    时间: 2012-2-24 23:18
谢谢楼主,真是太实用了

作者: 奇    时间: 2012-3-14 23:31
“再次路过……”我造一个-----特别路过

作者: 菜刀吻电线    时间: 2012-3-15 23:30
很有心,部分已收录自用,谢谢

作者: 彬彬    时间: 2012-3-16 18:58
  学习
作者: 奇    时间: 2012-4-19 23:22
都闪开,介个帖子,偶来顶

作者: tc    时间: 2012-4-27 23:19
心中有爱,爱咋咋地

作者: 奇    时间: 2012-7-6 23:27
真不错,全存下来了.

作者: 奇    时间: 2012-7-23 23:21
不错哦,谢谢楼主

作者: 驰骋的风    时间: 2012-7-24 09:30

高手速来赐教!kismet里面怎么加一个延迟DELAY??



unity特效大家PP_武功盖世呀








【严重分享】Unity3D_3.0破解版[安装包][下载]






高手请赐教!用模型做的特效动画材质丢失








antares_universe(vizio)可视化编辑

作者: C.R.CAN    时间: 2012-8-2 01:46
好可爱的字,学习了

作者: nts    时间: 2013-10-17 10:39
汽车很强大哦




欢迎光临 纳金网 (http://go.narkii.com/club/) Powered by Discuz! X2.5