Skip to main content
gamedev.net
🔒 Locked

Rigid Body Hierarchy

Started by orbano Jan 11, 2004 at 7:13 PM 2 replies 850+ views
Original Post
orbano
orbano
I want to build an object hierarchy of rigid bodies, so bodies can stick together to form a greater body, and fall apart, if a force tears them apart. Does anyone know any tutorials on this? I really need to know the data strucure, and a few algorithms for that to ditribute forces and torque. I was planning to implement an N-Tree for this, objejcts being leafs, and roots being connections/vitual objects (for localising collision). Please help! "Knowledge is no more expensive than ignorance, and at least as satisfying." -Barrin
"Knowledge is no more expensive than ignorance, and at least as satisfying." -Barrin
SpaceDude
SpaceDude
it depends on what you are talking about really... could u be a bit more precise? (can any body stick to any another body or only certain ones that fit together? can 1 body stick to more than 1 other body? is there a main body that all other will stick to? etc...)
Andos
Andos
If you use a force vector for each member of the body then you could simply test if the force (distance from 0,0 to point) is greater than some collapsing point and then deattach it from the body.
orbano
orbano
they can stick together through special objects, that stick them together (magnet, glue, etc). Forces are delivered from one sub object to other through these. They calculate, if the applying torque tears them apart (in subobject->main object direction they simply deliver the forces, then the torque is applied to the whole body, and then distributed to the subobjects).
The whole construct is similar to the construction of dynamic bounding boxes (i use a collision detection algorythm like that), but it would be also used for physical calculations.
When 2 objects stick together, a root object is created, that represents the 2 objects together, with a common center of mass, common bounding polihedron. When detecting collision, first, the collision is calculated with this common body, then localised to one of the subobjects. The applying force is calculated, and sent back to the root. It calculates the torques (how rotation and translation is affected), and sends it to the subobjects, so they can calculate, how big force is applied to the connection.

i hope you understand it, you know my english...

"Knowledge is no more expensive than ignorance, and at least as satisfying." -Barrin
"Knowledge is no more expensive than ignorance, and at least as satisfying." -Barrin

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.