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 » Mon May 17, 2010 1:57 pm

I was going to say that why not using a compound.
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 » Mon May 17, 2010 2:01 pm

Because I wasn't aware of them :D

I'll see if they're what I need.
User avatar
Pyritie
 
Posts: 36
Joined: Tue Mar 02, 2010 8:13 pm

Re: Sticking antibodies on a cell

Postby JernejL » Mon May 17, 2010 5:20 pm

they are THE totally rigid joints that you may want, also constructing them at runtime is usually very fast.
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 » Thu Jun 24, 2010 12:04 pm

Alright, so exams are over so now I can get back to work on this.

I made the compound collision but I got a few problems/questions:

- How do I add an "offset" to parts of the compound collision? My antibodies are small spheres and the cells are big spheres, and when I make a compound collision the small sphere just goes inside the big one. I want the small sphere to stick to the edge of the larger one.
- Both the cell and the antibody have the same collision but they don't "follow" each other as if they were connected. How do I do this?

I'll poke around a bit more and report back if I solve any of my own questions :U
User avatar
Pyritie
 
Posts: 36
Joined: Tue Mar 02, 2010 8:13 pm

Re: Sticking antibodies on a cell

Postby Pyritie » Tue Jun 29, 2010 11:59 am

bump
User avatar
Pyritie
 
Posts: 36
Joined: Tue Mar 02, 2010 8:13 pm

Re: Sticking antibodies on a cell

Postby Julio Jerez » Tue Jun 29, 2010 1:54 pm

every part on a compound have a offset matrix.
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 » Tue Jun 29, 2010 2:35 pm

where?
User avatar
Pyritie
 
Posts: 36
Joined: Tue Mar 02, 2010 8:13 pm

Re: Sticking antibodies on a cell

Postby Julio Jerez » Tue Jun 29, 2010 3:00 pm

in the shape when you make a sphere the funtion allow fo a matrix offset.
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 » Tue Jun 29, 2010 3:19 pm

so I have to make a sphere collision object with the offset just before creating the compound collision?

What about making the mesh follow around? Or is that just an ogre job?
User avatar
Pyritie
 
Posts: 36
Joined: Tue Mar 02, 2010 8:13 pm

Re: Sticking antibodies on a cell

Postby Julio Jerez » Tue Jun 29, 2010 4:34 pm

To build a compoundg collision first you have to have the parts that will make the compound collision.
The part is and array of convex shapes, each convex shape can face a offset matrix that will translate and rotate the part relative to the center of the compound.
the shape will move with teh body thit is attached to.
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 » Tue Jun 29, 2010 4:58 pm

okay but when I make the antibody, it has to have a regular sphere. Then when it attaches it gets the offset. So I have to make another collision when it attaches. But the only way I can see to set the antibody's Body's collision to the offset one is by creating a new body... am I doing this wrong?
User avatar
Pyritie
 
Posts: 36
Joined: Tue Mar 02, 2010 8:13 pm

Re: Sticking antibodies on a cell

Postby Julio Jerez » Tue Jun 29, 2010 5:11 pm

No, you can just make a new compound and call NewtonSetShape, the othe will be release and destroy.
basically the algorithm is like this

    -call GetCollision from the body
    -Call GetCollisionInfo of the shape.
    -place all the compounds of the old collision into one array
    -add the new sphere to the end of the array
    -make a compound with thsi new array
    -Set this collision to the body.
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 8:17 am

I don't see any GetCollisionInfo. There's GetCollisionPrimitiveType but I get "'MogreNewt.Collision.CollisionPrimitiveType' is inaccessible due to its protection level" when I try to use it.
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 8:48 am

void NewtonCollisionGetInfo (const NewtonCollision* collision, NewtonCollisionInfoRecord* collisionInfo);
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 9:00 am

Hm, still not there. I'll ask someone on the OgreNewt forums where they moved it to.
User avatar
Pyritie
 
Posts: 36
Joined: Tue Mar 02, 2010 8:13 pm

PreviousNext

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 2 guests

cron