Sticking antibodies on a cell

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Re: Sticking antibodies on a cell

Postby Julio Jerez » Wed Jun 30, 2010 11:39 am

did you find the funtion collision info?

when you can tha funtion with a pointe to a compoun collision it will give you back all of teh collision shspes that are part o fteh compoint.
all you need to do is go over the array and use those as the parts for the new compound. then you append the new one.
by doing that, you can add and remove pieces from a compound at will

What do you not get?
what do you have? maybe I can write some part to get you started.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Sticking antibodies on a cell

Postby Pyritie » Wed Jun 30, 2010 11:42 am

No, I get what I should do, I just can't find the right function in the wrapper I'm using.
User avatar
Pyritie
 
Posts: 36
Joined: Tue Mar 02, 2010 8:13 pm

Re: Sticking antibodies on a cell

Postby Julio Jerez » Wed Jun 30, 2010 11:46 am

Ha it may no be, teh worper is no fully completed. My guess is that peopel add stuff as they need it.
GetCollisionInfo is one of those occure features that may not had being in teh mind of anyone at the time teh collision system in the wrapper was written.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Sticking antibodies on a cell

Postby Pyritie » Wed Jun 30, 2010 11:54 am

Hm, if that's the case I really don't want to have to add that in myself.

Would just holding on to the array in the Cell object do the same sort of thing?
User avatar
Pyritie
 
Posts: 36
Joined: Tue Mar 02, 2010 8:13 pm

Re: Sticking antibodies on a cell

Postby Julio Jerez » Wed Jun 30, 2010 1:04 pm

Pyritie wrote:Would just holding on to the array in the Cell object do the same sort of thing?

Yes that will do the same trick.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Sticking antibodies on a cell

Postby Pyritie » Fri Jul 16, 2010 8:18 am

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.

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?
User avatar
Pyritie
 
Posts: 36
Joined: Tue Mar 02, 2010 8:13 pm

Re: Sticking antibodies on a cell

Postby JernejL » Fri Jul 16, 2010 2:21 pm

well, you can add same collision to a compound several times, it's not a problem.. just keep adding same collision with different matrix.
Help improving the Newton Game Dynamics WIKI
User avatar
JernejL
 
Posts: 1587
Joined: Mon Dec 06, 2004 2:00 pm
Location: Slovenia

Re: Sticking antibodies on a cell

Postby Pyritie » Fri Jul 16, 2010 2:44 pm

Yeah but the antibody meshes don't follow the compound collision.
User avatar
Pyritie
 
Posts: 36
Joined: Tue Mar 02, 2010 8:13 pm

Re: Sticking antibodies on a cell

Postby Julio Jerez » Fri Jul 16, 2010 3:07 pm

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)
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Sticking antibodies on a cell

Postby Pyritie » Fri Jul 16, 2010 3:43 pm

Julio Jerez wrote:
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.
No they are different, so each cell's compound will most likely be different

Julio Jerez wrote:
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)

Pff, easy? :P

thanks, I'll go stick that in now~
User avatar
Pyritie
 
Posts: 36
Joined: Tue Mar 02, 2010 8:13 pm

Re: Sticking antibodies on a cell

Postby Pyritie » Fri Jul 16, 2010 4:20 pm

I don't see anything about matrices - just Vector3s and Quaternions. D:
User avatar
Pyritie
 
Posts: 36
Joined: Tue Mar 02, 2010 8:13 pm

Re: Sticking antibodies on a cell

Postby Julio Jerez » Fri Jul 16, 2010 4:45 pm

That was just General Matrix algebra. if you you using you won Math Matrix the expresion apply,
all you need it the matrix mutlity operator and a way to convert forn NewtonGetMatrix to teh matrix format.
if you are using the dMatrix Class tah coem with newton SDFK, they the expresion can be use literatly and I wroted it.
do you use your won engine?
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Sticking antibodies on a cell

Postby Pyritie » Fri Jul 16, 2010 4:58 pm

...I didn't really understand much of that, but I'm using MogreNewt, a C# wrapper for OgreNewt.
User avatar
Pyritie
 
Posts: 36
Joined: Tue Mar 02, 2010 8:13 pm

Previous

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 0 guests

cron