🔒 Locked
Force - Object
Advertisement
Original Post
Hi there! I'm having a little problem with creating a little physics (2D) sim. Imagine there is an object consisting of several vertices, line segments that connect tose vertices (a hull) and a center of mass. Now because of a collision (or whatever) there is a point on the object's hull, from which a force (a 2D vector) shall be applied. What's the right way to do this? Simply add the force to every vertex' force variable? Actually the whole thing must somehow be weighted: vertices closer to the center of mass get less force, and vertices on the opposing side of the CM have to be moved in the reverse direction (so that the object starts to spin, if it is hit at one edge)...do you know what I mean? It's hard to explain ;-) What's the right approach for this? Thanks for your help!
You need to have an angular velocity also to your shape. This is not exact but will give you the behavior you're looking for and is fairly straightforward. When you apply the velocity of the object to the vertices, you also rotate all the vertices around the center of mass by the angular velocity.
To figure out the angular velocity that a force imposes, first, imagine a circle centered on the center of mass and passing through the contact point. You can break the force at the contact point into 2 perpendicular components: one that points directly at the center of mass, and the other which is tangental to the circle. The force toward the center is translational force (which applies to all vertices the same), and the tangental force causes the shape to start spinning.
Now, F = ma, and angular acceleration (alpha) = a/r, so
F = mr * alpha, so
alpha = F/mr
so if you take the tangental component of force and divide it by the mass times the distance from the CoM of the contact point, you have an angular acceleration, which you can apply to angular velocity just like linear acceleration works with linear velocity.
I should point out that this approach simplifies a bunch of things involving inertia which would otherwise be much more complicated.
To figure out the angular velocity that a force imposes, first, imagine a circle centered on the center of mass and passing through the contact point. You can break the force at the contact point into 2 perpendicular components: one that points directly at the center of mass, and the other which is tangental to the circle. The force toward the center is translational force (which applies to all vertices the same), and the tangental force causes the shape to start spinning.
Now, F = ma, and angular acceleration (alpha) = a/r, so
F = mr * alpha, so
alpha = F/mr
so if you take the tangental component of force and divide it by the mass times the distance from the CoM of the contact point, you have an angular acceleration, which you can apply to angular velocity just like linear acceleration works with linear velocity.
I should point out that this approach simplifies a bunch of things involving inertia which would otherwise be much more complicated.
What's really funny about that name is that Verlet integration has nothing to do with the mass-spring systems that Jakobsen wrote about in Advanced Character Physics (the paper that everyone knows this technique by). You can apply verlet integration to many other fixed-timestep problems, and you can simulate the mass-spring systems any way choose.
It's totally arbitrary. It's like calling something a "butter-knife muffin" just because you used a butter-knife to spread the jelly.
It's totally arbitrary. It's like calling something a "butter-knife muffin" just because you used a butter-knife to spread the jelly.
Quote:
Original post by ajas95
What's really funny about that name is that Verlet integration has nothing to do with the mass-spring systems that Jakobsen wrote about in Advanced Character Physics (the paper that everyone knows this technique by). You can apply verlet integration to many other fixed-timestep problems, and you can simulate the mass-spring systems any way choose.
It's totally arbitrary. It's like calling something a "butter-knife muffin" just because you used a butter-knife to spread the jelly.
true. i considered being a little more technical, but then again that wouldnt have helped him in his searches.
Quote:
Original post by Eelco
the best advice i can give you at this moment is to tell you youre totally on the wrong track.
find yourself some introductory information on rigid body simulation, either from the internet, which has plenty of decent sources on the subject, or you could pick up a book.
are there some standard books on game collision detection/physics or books you`d suggest?
there hasn't been an exhaustive, all-knowing physics books for games just yet. The best I can recommend is Dave Eberly's "Game Physics" books, but that's for like designing a physics engine, so it's not an easy read, and not 100 complete (especially on the collision detection side).
for that, you can have a look at
"Collision Detection in Interactive 3D Environments" - Gino van den Bergen.
The guy who design the SOLID collision detection library, based on the GJK algorithm. I haven;t read the book though, but he sure knows a lot about CD. Quite advanced probably. May be it's also quite narrow in its scope, but I could be wrong.
"Physics for Game Developers" - David M Bourg
More like an introduction to physics, and has some useful case studies. If you've never done physics before, that would be a good introduction book.
So all in all, in my opinion, there is not one single book that covers everything required to design an all-purpose physics engine, and also relates to the more obsure methods that can be used (BSP trees, voxels, deformable scenery, ect...). But that book would have to be 1000s of pages thick :)
For all of these, you still need to have at least some basic knowledge of linear algebra, geometry, trigonometry, and the likes... Physics is math-heavy.
BTW, head to the book section here...
http://www.gamedev.net/columns/books/books.asp?CategoryID=13
for that, you can have a look at
"Collision Detection in Interactive 3D Environments" - Gino van den Bergen.
The guy who design the SOLID collision detection library, based on the GJK algorithm. I haven;t read the book though, but he sure knows a lot about CD. Quite advanced probably. May be it's also quite narrow in its scope, but I could be wrong.
"Physics for Game Developers" - David M Bourg
More like an introduction to physics, and has some useful case studies. If you've never done physics before, that would be a good introduction book.
So all in all, in my opinion, there is not one single book that covers everything required to design an all-purpose physics engine, and also relates to the more obsure methods that can be used (BSP trees, voxels, deformable scenery, ect...). But that book would have to be 1000s of pages thick :)
For all of these, you still need to have at least some basic knowledge of linear algebra, geometry, trigonometry, and the likes... Physics is math-heavy.
BTW, head to the book section here...
http://www.gamedev.net/columns/books/books.asp?CategoryID=13
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement