纳金网

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

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


           Think about what happens to a car in a sharp turn. [...] the part of the car on the outside of the turn gets pushed down toward the road and the part of the car on the inside of the turn rises up. In other words, the body of the car "rolls" 10 or 20 or 30 degrees toward the outside of the turn. If you take a turn fast enough, the tires on the inside of the turn actually rise off the road and the car flips over.
           

           Sounds familiar?
           

           Stabilizer bars "link" the two wheels of the same axle allowing a limited degree of freedom between them. When one of the wheels is pushed upwards, the stabilizer bar transfers a portion of that compression force to the other wheel, so its suspension compress as well. This limits the roll of the body's car at that axle.
         

           If you don't have a stabilizer bar, you tend to have a lot of trouble with body roll in a turn. If you have too much stabilizer bar, you tend to lose independence between the suspension members on both sides of the car.
           

           Q: I haven't heard of such bars! Are really so important?
           

           A: Absolutely. Stabilizer bars are an essential part of a vehicle's suspension system in the same way as springs and dampers are.
         

           Look under your car, observe the suspension behind the front wheels. You'll be able to easily identify a rigid bar that travels from one wheel's suspension to another. That's it. The only exceptions are a very few car models that use dynamic systems (ej. computer-controlled hydraulic systems) to actively emulate the behavior of the anti-roll bars in turns.
           

           IMHO, an AntiRoll script for WheelColliders should be at least mentioned in the documentation and tutorials as a basic requirement for physically real vehicles. Actually, anti-roll bars are barely mentioned in the last chapter of the Unity's Car Tutorial (
           
            http://unity3d.com/support/resources...s/car-tutorial
           
           ), where an alternate car physics model is proposed.
         

           Q: What about all other solutions proposed here? (lower center of mass, angular drag, custom friction models...)
           

           A: The essential requirements for having a car that physically feels like real include the anti-roll bars.
         

           Once you have the REAL absolutely simple car (rigidbody + four wheel colliders + 2 anti-roll bars) you can then apply all other techniques to get special behaviors on your car and/or tweaking its handling, i.e for arcade-style driving.
         

           Even with the real absolutely simple car you'll find a lot of options to tweak and play with, all of them affecting the handling and feel of the car: mass, REAL center of mass (typically moved towards the engine location), front-rear springs, front-rear dampers (must be different because the axle under the engine will support more weight), front-rear anti-roll bar stiffness...
         

           No need for complicated custom friction/drag models at the beginning - leave them for final tweaks if necessary. You'll see how much the handling can change by simply adjusting the difference between the stiffness of the front and rear stabilizer bars.
         

           Q: What's bad with lowering the center of mass?
           

           A: Jumps, collisions, crashes or air-tricks will look weird because of the false center of mass.
         

           Artificially lowering the center of mass is just a workaround that works under some circumstances, but fails at others. Having the REAL center of mass in the car, and making it stable by means of stabilizer bars, will make almost all situations behave like real.
         

           Q: I've***n your demo and I've made the car flip in "Sport" mode!
           

           A: Look at that kind of car. If you do a close turn at high speed with that car in real, surely you'd roll over as well!
         

           If you are (like me) used to watch those "educative" documentaries at Discovery Channel "Road Rampage", "Destroyed in Seconds", and so on, you'll know how easily this kind of cars can roll over at relatively normal speeds. Also, you may have heard about "The moose test", which is a heavy "S" turn test performed at 80 Km/h (50 mph). Many actual cars failed that test (Google for "the moose test" or see
           


            http://en.wikipedia.org/wiki/Moose
            
             _
            
            test
           
           )
         

           Note that in the demo the elevation of the center of mass is around the middle of the car's body! You must do a hard turn at around 60 Km/h (40 mph) for being able to flip the car in "Sport" mode. The anti-roll bars are doing an excellent work already.
         

            
           


作者: C.R.CAN    时间: 2012-2-23 23:28
再次路过……

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

作者: 菜刀吻电线    时间: 2012-6-23 23:20
俺是新人,这厢有礼了!

作者: tc    时间: 2012-7-8 23:22
“再次路过……”我造一个-----特别路过

作者: 晃晃    时间: 2012-9-28 23:26
很有心,部分已收录自用,谢谢

作者: nts    时间: 2013-10-17 10:39
全是专业级的文件,thx
作者: Icestar    时间: 2013-10-17 11:44
飘过~~~~




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