NewtonBodySetMatrixRecursive requirements

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

NewtonBodySetMatrixRecursive requirements

Postby tiresius » Thu Jul 09, 2009 11:22 pm

Hello everyone!

I am almost done with 1.53, soon I can move onto 2.0!

I had a bit of a scare, though, with the Joint interface. Nothing in the wrapper code or the Newton.h changed in relation to the joints, but my joint demo was crashing. I narrowed it down to crashing in NewtonUpdate() if function NewtonBodySetMatrixRecursive() is used on a zero mass object, attached by joint to an object with mass.
I noticed the wiki says this (same as CHM file):
this funtion should not be used to transform set of articulated bodies that are connected to a static body. doing so will result in umprediactable results. Think for example moving a chain attached to a ceiling from one place to another, to do that in real life a person first need to desconect the chain (destroy the joint), move the chain (apply the tranfomation to the entire chain), the reconect it in the new position (recreate the joint again).

Now to add to my confusion, in one of my projects I have a hinge joint working off a Tree Collision object without issue from NewtonBodySetMatrixRecursive, but when I try to do the same in a small demo it fails (crashes). So I was wondering if there's a hard/fast rule that I'm just lucky to avoid in that one project?
And this sort of thing used to work well in 1.32, so I'm wondering why the decision to take it away? It was quite handy to set a joint on a static body near the 0,0,0 coordinates and then move/rotate the static body wherever you want with the movable joint following. I feel I may have to do some translation/offset math now with joints. :(
Thanks for any insight.
tiresius
 
Posts: 32
Joined: Tue Nov 09, 2004 9:15 pm

Re: NewtonBodySetMatrixRecursive requirements

Postby JernejL » Fri Jul 10, 2009 3:15 am

do you know which particular joint is crashing? if it's a userjoint make sure you set the maxdof properly!
Help improving the Newton Game Dynamics WIKI
User avatar
JernejL
 
Posts: 1587
Joined: Mon Dec 06, 2004 2:00 pm
Location: Slovenia

Re: NewtonBodySetMatrixRecursive requirements

Postby Julio Jerez » Fri Jul 10, 2009 8:35 am

My guess is trnaform recursive in 1.32 had a bug, it shoudl no muve joint linh to the world,

The first package of tutorials is up. I still need to put teh Text in the WIKI but I iwll do that very soon,
The sample are very simple and clear so that non CPP programmer can undestand then with eassy.
http://newtondynamics.com/wiki/index.php5?title=Tutorials
Migrating to 2.0 using these tutorial for gidance will be more productive than trying to solve Bugs in 1.53 and 1.32.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: NewtonBodySetMatrixRecursive requirements

Postby tiresius » Fri Jul 10, 2009 10:35 pm

Delfi wrote:do you know which particular joint is crashing?

It ends up being any joint that used the NewtonBodySetMatrixRecursive function. :(

Julio Jerez wrote:My guess is trnaform recursive in 1.32 had a bug,

I've set it in the wrapper so users cannot do a NewtonBodySetMatrixRecursive on a mass=0 body, it returns a popup error.

In my usage of NewtonBodySetMatrixRecursive on a body with mass (a worm object- spheres connected by several ball joints) I found that as long as the rotational vector is not 0.0, 0.0, 0.0 and at least one axis has a value, it doesn't crash (?). So perhaps there is a bug in 1.53 as well? Or perhaps it is still something the wrapper is doing, but I have it working and that is good enough for me.

Julio, the tutorial I read looks really good and very simple. Looking forward to the others. Are you writing the text for them yourself?
An apple fell on my head and I haven't been the same since...
tiresius
 
Posts: 32
Joined: Tue Nov 09, 2004 9:15 pm

Re: NewtonBodySetMatrixRecursive requirements

Postby Julio Jerez » Sat Jul 11, 2009 12:24 am

I am writing teh text yes , but the some one else is fix my grammar.
I about the complete the secund doc, and over the weekend I will do few mores.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 0 guests