Pyritie wrote:Next question: how do I get the antibodies to use the same compound collision? At the moment the cell is using the compound but the antibodies aren't - how do I tell them to use it?
I am confused, are a cell and an antibody the same kind of object?
Because if you are making compound a run time they will not be the same sicne each body will be colliding in diffrent palces, so essencially each body will have his own compound.
You can have a compound can create as many newton bodies ar you want, each one will have his own intace and reusin the static parts.
you can also use SetCollisin and passt a compound, but I asume that if you get this far you are doin tha talready.
Pyritie wrote:Okay okay so I got the general idea working (still working on the math to figure out the offset, but I'm working on that). The cell's collision is being updated and whatnot.
as for the offset. that is very eassy. all you need to do is to position the new collision shape in global space.
that is you get the location and orientation of the new collision piece, which I asume will be the instantanues oriention of the body that collide with yout cell.
you also get the Transfomation matrix of the Body to which you want to attach the new collision piece.
They are in global space.
Then the question you ask yoursefl is: how does the body sees this new collision pieces in his own frame of reference. that is:
let Matrix A be the matrix of tha Cell:
let Matrix S be the matrix of teh new collison part
let matrix O teh offset of teh matrix in local space
the ther ewill be a relation
S = O * A
that is the collsion shape matrix is equal to some local offset matrix motiplied by the Body matrix.
then your offset matrix for the new collision shape is:
O = S * inverse (A)