A place to discuss everything related to Newton Dynamics.
Moderators: Sascha Willems, walaber
by Julio Jerez » Mon May 17, 2010 1:57 pm
I was going to say that why not using a compound.
-
Julio Jerez
- Moderator

-
- Posts: 12426
- Joined: Sun Sep 14, 2003 2:18 pm
- Location: Los Angeles
-
by Pyritie » Mon May 17, 2010 2:01 pm
Because I wasn't aware of them

I'll see if they're what I need.
-

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

JernejL
-
- Posts: 1587
- Joined: Mon Dec 06, 2004 2:00 pm
- Location: Slovenia
-
by 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
-

Pyritie
-
- Posts: 36
- Joined: Tue Mar 02, 2010 8:13 pm
by Pyritie » Tue Jun 29, 2010 11:59 am
bump
-

Pyritie
-
- Posts: 36
- Joined: Tue Mar 02, 2010 8:13 pm
by Julio Jerez » Tue Jun 29, 2010 1:54 pm
every part on a compound have a offset matrix.
-
Julio Jerez
- Moderator

-
- Posts: 12426
- Joined: Sun Sep 14, 2003 2:18 pm
- Location: Los Angeles
-
by Pyritie » Tue Jun 29, 2010 2:35 pm
where?
-

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

-
- Posts: 12426
- Joined: Sun Sep 14, 2003 2:18 pm
- Location: Los Angeles
-
by 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?
-

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

-
- Posts: 12426
- Joined: Sun Sep 14, 2003 2:18 pm
- Location: Los Angeles
-
by 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?
-

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

-
- Posts: 12426
- Joined: Sun Sep 14, 2003 2:18 pm
- Location: Los Angeles
-
by 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.
-

Pyritie
-
- Posts: 36
- Joined: Tue Mar 02, 2010 8:13 pm
by Julio Jerez » Wed Jun 30, 2010 8:48 am
void NewtonCollisionGetInfo (const NewtonCollision* collision, NewtonCollisionInfoRecord* collisionInfo);
-
Julio Jerez
- Moderator

-
- Posts: 12426
- Joined: Sun Sep 14, 2003 2:18 pm
- Location: Los Angeles
-
by 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.
-

Pyritie
-
- Posts: 36
- Joined: Tue Mar 02, 2010 8:13 pm
Return to General Discussion
Who is online
Users browsing this forum: No registered users and 4 guests