|
I would like to reach the effect of for example putting/spawning a stone on the back of a truck. I'd like to behave it realistically. Searched almost everywhere, couldn't find an answer... Parenting two rigidbodies or turning ON isKinematic on the child doesn't do the trick. I also can't use altering the transforms, nor MovePosition. I really hope there's a reasonable solution out there somewhere.. Pleeease helppp!
(comments are locked)
|
|
Did you consider reading the documentation on physics or rigidbodies? They clearly state:
Consider what you want to do. You have a rock on the back of a truck, but what keeps the rock on the back of the truck? Friction which cannot exist without the forces of gravity, the materials' surfaces' effect on friction, and collision.
What does this mean? To behave somewhat realistically:
There are all sorts of things that aren't properly emulated within physics simulation, like aerodynamics and buoyancy for example so it will never be perfectly realistic. If you don't care how the rock behaves once it is in the truck, you could always add code to remove the rigidbody and parent the truck to the rock OnCollision if you like. My seeing on this problem is unsolvable without a trick is strengthened. The level of realism is a misunderstanding. I don't want the stone to move an inch but to pull the truck's butt sideways in tight corners. Or: couldn't I make a see-saw with totally fixed parts, with seats on each side via runtime changeable masses?
Dec 15 '10 at 08:03 PM
BitMiller
You want the rock to not move, but the rear of the truck to swing out in tight turns? Ignoring the flaws with the realism of that, to get the physics engine to generate that behaviour may require a more complex setup, but the one you describe seems incorrect as mass isn't really changing per side. Essentially, you'll want shift your centerOfMass and be very picky about how and where you apply forces. If your truck is kinematic, then you'd likely have to fake this faux inertia yourself.
Dec 16 '10 at 05:22 PM
skovacs1
(comments are locked)
|
|
@Gil the short answer I believe is that the way to go about what you want to do is to: a) Increase the mass of the truck object itself each time an object is added b) Change the centre of mass of the truck (including rocks) by hand to account for the new weight distribution Part b will require understanding centre of mass calculations for discreet objects, see centre of mass for particles here http://hyperphysics.phy-astr.gsu.edu/hbase/cm.html Might be confusing if you're not familiar with physics concepts but Physx doesn't have any way to 'weld' or compound rigidbodies together in a way that preserves their respective mass distributions to my knowledge... It does create combined objects out of child colliders - but those items are not going to be physically interacting with each other. For example a stone applied to the truck could be added as a new collider and the mass of the truck increased as you suggest - this would automatically move the centre of gravity etc.
Oct 05 '12 at 02:59 PM
whydoidoit
(comments are locked)
|
