Andy Gilbert Posted January 6, 2012 Share Posted January 6, 2012 Hi, ok i dont use unity but whilst researching more into drag and angular drag online i found that unity has these two properties built in as standard into its physics engine which confuses me because. Everywhere i look into calculating drag i come accross the standard equation: D = Cd * A * .5 * r * V^2 where you need to know, air density, a drag coefient & area of body. Yet it looks like in unity you can add an object and apply angular and motion drag without any of the above properties being inputted, so how can it be done? I ask because i want to do the same in leadwerks, i want to add some simple drag to my bodys both angular and velocity without having to touch air density or coeffienents. Update: found this on their forum (i didnt realise unity used phyx) dragForceMagnitude = velocity.magnitude ^ 2 * drag; // The variable dragForceVector = dragForceMagnitude * -velocity.normalized Thanks Andy Quote The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do. Leadwerks Game-Ready 3D Models:https://sellfy.com/gib3d Link to comment Share on other sites More sharing options...
Pixel Perfect Posted January 7, 2012 Share Posted January 7, 2012 Everywhere i look into calculating drag i come accross the standard equation: D = Cd * A * .5 * r * V^2 where you need to know, air density, a drag coefient & area of body. Yet it looks like in unity you can add an object and apply angular and motion drag without any of the above properties being inputted, so how can it be done? I'm guessing that their simulation of drag is a very simple one and makes a lot of assumptions. I suspect you might wait some time before anyone answers this post Andy, you might be better just experimenting or posting on a physics based forum / thread where your more likely to attract the people who might be able to shed some light on this. Quote Intel Core i5 2.66 GHz, Asus P7P55D, 8Gb DDR3 RAM, GTX460 1Gb DDR5, Windows 7 (x64), LE Editor, GMax, 3DWS, UU3D Pro, Texture Maker Pro, Shader Map Pro. Development language: C/C++ Link to comment Share on other sites More sharing options...
Andy Gilbert Posted January 7, 2012 Author Share Posted January 7, 2012 Hi Pixel, thanks for reply, think your right, Ill go do some more looking. Cheers Andy Quote The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do. Leadwerks Game-Ready 3D Models:https://sellfy.com/gib3d Link to comment Share on other sites More sharing options...
flachdrache Posted January 7, 2012 Share Posted January 7, 2012 For what is it used then ?! ... you should forget about the "correct" way in computer games since its stated as being "allways" to expensive to calculate - e.g. if you want/can use joints controll its rigidity and let it add up to object mass ... but you know what i mean. Quote AMD 64 X2 Dual 5k - 4GB - XFX GForce9800GT - nv196.21 - WinXP Sp3 zBrush4R2 - Silo2Pro - Unwrap3DPro - Gile - MaPZone2.5 Xxploration FPS in progress ... Link to comment Share on other sites More sharing options...
flachdrache Posted January 7, 2012 Share Posted January 7, 2012 ps : your statement is wrong - as soon as the cloud`s going to reconfigure your pc config to better read its data youll know what i mean. Quote AMD 64 X2 Dual 5k - 4GB - XFX GForce9800GT - nv196.21 - WinXP Sp3 zBrush4R2 - Silo2Pro - Unwrap3DPro - Gile - MaPZone2.5 Xxploration FPS in progress ... Link to comment Share on other sites More sharing options...
Andy Gilbert Posted January 7, 2012 Author Share Posted January 7, 2012 Hi Flachdrache, i just want to add some drag and angular drag to my rigid bodies. Im not sure how the method you describe works, coiuld you explain more? And you have completly lost me on your 2nd post. Thanks Andy Quote The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do. Leadwerks Game-Ready 3D Models:https://sellfy.com/gib3d Link to comment Share on other sites More sharing options...
Road Kill Kenny Posted January 7, 2012 Share Posted January 7, 2012 Hi Andy, I simulated drag on a vehicle that I was doing in Leadwerks some time ago. The equation in your first post is correct. You just have to assume and approximate a lot of the variables. D = Cd * A * .5 * r * V^2 Cd - Look up some standard coefficients of drag and pick one A - estimate the average facinga area of your model. Approximate is ok remember. V - well you can get that. Its simply the velocity of your object. r... ah remind me what this one is anyway all you have to do is get the opposing vector to the direction of travelt (i.e. a nomralized and negative velocity vector) and then apply the force D that you get from the approximate equation to your object. Now if you don't get a good result.. play around with Cd & A values till it looks right. P.S. I like the screenshot of your game on your blog. You're getting a nice natural look there Quote STS - Scarlet Thread Studios AKA: Engineer Ken Fact: Game Development is hard... very bloody hard.. If you are not prepared to accept that.. Please give up now! Link to comment Share on other sites More sharing options...
flachdrache Posted January 7, 2012 Share Posted January 7, 2012 Hey - iam puzzled as well since its a nice to have ... the guess i made was geared forward to gamelibs implementation which i guess just hooks the bodys mass center to a joint ... momentum usually will do the rest for us imho. I mean, its a physics lib if using joints all we can control is joint stiffness afaik. PS: i just saw your "The good news about computers ..." quote ... dont mind, i just meant that we have to fight for our hard disk drives now - or we will get pre-configured. (censored) @Engineer Ken - dont you just try to outsmart newton lib ?! Quote AMD 64 X2 Dual 5k - 4GB - XFX GForce9800GT - nv196.21 - WinXP Sp3 zBrush4R2 - Silo2Pro - Unwrap3DPro - Gile - MaPZone2.5 Xxploration FPS in progress ... Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.