A place to discuss everything related to Newton Dynamics.
Moderators: Sascha Willems, walaber
by Carli » Sat Jan 09, 2010 4:55 pm
Hi.
How can i implement a joint that connects two bodys to a stiff unit?
-
Carli
-
- Posts: 245
- Joined: Fri Oct 02, 2009 5:28 am
by JernejL » Sat Jan 09, 2010 5:45 pm
A compound collision works best for such cases..
-

JernejL
-
- Posts: 1587
- Joined: Mon Dec 06, 2004 2:00 pm
- Location: Slovenia
-
by PJani » Sat Jan 09, 2010 6:12 pm
or you can create custom rigid joint...
| i7-5930k@4.2Ghz, EVGA 980Ti FTW, 32GB RAM@3000 |
| Dell XPS 13 9370, i7-8550U, 16GB RAM |
| Ogre 1.7.4 | VC++ 9 | custom OgreNewt, Newton 300 |
| C/C++, C# |
-

PJani
-
- Posts: 448
- Joined: Mon Feb 02, 2009 7:18 pm
- Location: Slovenia
by JernejL » Sat Jan 09, 2010 7:51 pm
PJani wrote:or you can create custom rigid joint...
Julio advised against it, solving a rigid joint is difficult and won't work as precise and fast as the compound collision can.
-

JernejL
-
- Posts: 1587
- Joined: Mon Dec 06, 2004 2:00 pm
- Location: Slovenia
-
by Carli » Sun Jan 10, 2010 9:21 am
Delfi wrote:A compound collision works best for such cases..
But i can't stack them!
-
Carli
-
- Posts: 245
- Joined: Fri Oct 02, 2009 5:28 am
by kallaspriit » Sun Jan 10, 2010 10:41 am
What do you mean by stacking, you can add several collisions to a compound.
-
kallaspriit
-
- Posts: 216
- Joined: Sun Aug 14, 2005 6:31 pm
by JernejL » Sun Jan 10, 2010 10:45 am
Carli wrote:Delfi wrote:A compound collision works best for such cases..
But i can't stack them!
They should stack just fine, show what's the problem.
-

JernejL
-
- Posts: 1587
- Joined: Mon Dec 06, 2004 2:00 pm
- Location: Slovenia
-
by Carli » Sun Jan 10, 2010 1:07 pm
with stacking i ment the recursive compound collision.
-
Carli
-
- Posts: 245
- Joined: Fri Oct 02, 2009 5:28 am
by JernejL » Sun Jan 10, 2010 1:42 pm
But you can add pieces from 1 compound to another.. that is no problem.
-

JernejL
-
- Posts: 1587
- Joined: Mon Dec 06, 2004 2:00 pm
- Location: Slovenia
-
by PJani » Sun Jan 10, 2010 2:15 pm
It would be nice if would be possible to add or remove compound collisions at run time:)
| i7-5930k@4.2Ghz, EVGA 980Ti FTW, 32GB RAM@3000 |
| Dell XPS 13 9370, i7-8550U, 16GB RAM |
| Ogre 1.7.4 | VC++ 9 | custom OgreNewt, Newton 300 |
| C/C++, C# |
-

PJani
-
- Posts: 448
- Joined: Mon Feb 02, 2009 7:18 pm
- Location: Slovenia
by JernejL » Sun Jan 10, 2010 5:08 pm
PJani wrote:It would be nice if would be possible to add or remove compound collisions at run time:)
You can.. by rebuilding it, it is very fast actually..
-

JernejL
-
- Posts: 1587
- Joined: Mon Dec 06, 2004 2:00 pm
- Location: Slovenia
-
by PJani » Sun Jan 10, 2010 6:00 pm
Delfi wrote:PJani wrote:It would be nice if would be possible to add or remove compound collisions at run time:)
You can.. by rebuilding it, it is very fast actually..
I never consider that option.

| i7-5930k@4.2Ghz, EVGA 980Ti FTW, 32GB RAM@3000 |
| Dell XPS 13 9370, i7-8550U, 16GB RAM |
| Ogre 1.7.4 | VC++ 9 | custom OgreNewt, Newton 300 |
| C/C++, C# |
-

PJani
-
- Posts: 448
- Joined: Mon Feb 02, 2009 7:18 pm
- Location: Slovenia
by Carli » Mon Jan 11, 2010 4:12 am
But I do really need a stiff joint!
I want to attach a null-collision-body to an other body. A clever answer like "use a compound collision" is trash.
Or do I need to delete the body from the world and set the relative matrix myself each frame?
-
Carli
-
- Posts: 245
- Joined: Fri Oct 02, 2009 5:28 am
by JernejL » Mon Jan 11, 2010 4:48 am
Carli wrote:But I do really need a stiff joint!
I want to attach a null-collision-body to an other body. A clever answer like "use a compound collision" is trash.
Or do I need to delete the body from the world and set the relative matrix myself each frame?
You can change body's collision at runtime without destroying the body, the function to achieve this is named NewtonBodySetCollision.
A few topics about this:
viewtopic.php?f=9&t=5558&p=40089&hilit=rigid+jointviewtopic.php?f=9&t=5181&p=36956&hilit=rigid+jointviewtopic.php?f=15&t=4056&p=27525&hilit=rigid+joint (example rigid joint implementation) But if you consider my answers trash then i can stop trying to help you, i suggested you a working solution to a problem that came up on the forum several times already and Julio himself suggested compounds, compounds are also much more optimized in this regard and won't put as much strain on cpu usage, i'm using them in one project to simulate complex spaceship shapes, and the performance and speed is faster than what i expected. You cannot put a compound in compound - yes, but that's a small issue, which you can easily resolve with very little matrix math.
-

JernejL
-
- Posts: 1587
- Joined: Mon Dec 06, 2004 2:00 pm
- Location: Slovenia
-
by Carli » Mon Jan 11, 2010 9:15 am
It would make no sense - i would add a null-collision to a compound and i even do not have two different matrices (which i need for graphics)
there are two other solutions for me:
- removing one object and setting the matrix myself each frame without a newton body
- changing the whole network code because the object will not longer exists but still has a graphical body
--> A stiff joint would be much easier and i do not have to make any workaround
plus i can some other things like attaching a body to another dynamically
-
Carli
-
- Posts: 245
- Joined: Fri Oct 02, 2009 5:28 am
Return to General Discussion
Who is online
Users browsing this forum: No registered users and 2 guests