Slider joint gets weak when moving away from origin

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Slider joint gets weak when moving away from origin

Postby fractile » Sun May 05, 2013 11:48 am

I have a game scene with world size set to about 240x100x20 units, centered at origin. There is one tree collision (game level) slightly smaller than the world size and multiple box collisions (sliding doors) connected to the tree collision with slider joints (CustomSlider from the joint library). Newton version is 2.36, built to use floats (not doubles).

Here's a screenshot of a door near world origin:
Image

And this is what doors near world edge look like:
Image

The problem is that a door placed near world origin stays firmly in its place, but doors placed further away from the origin slowly slide down (in direction of negative Y axis, while slider axis is positive Z). The amount they slide down seems to be linearly dependent on the distance from origin. Also, setting the world size smaller stops all doors from sliding down, but that is obviously not a real solution here.

This sounds like some sort of accuracy problem, but shouldn't 32 bit floats be enough for world of this size?

Any help would be greatly appreciated.
fractile
 
Posts: 37
Joined: Wed Jun 07, 2006 2:26 pm

Re: Slider joint gets weak when moving away from origin

Postby Julio Jerez » Sun May 05, 2013 1:29 pm

I do no think that has to do with world size. But I do not know what could that be in core 200. You need to upgrade to core 300.
core 200 is too old and I am not debugging anymore. Moving to core 300 take you like a day of work and many those issues are resolved.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Slider joint gets weak when moving away from origin

Postby fractile » Sun May 05, 2013 2:19 pm

I tried upgrading to core 300 at end of last year, but I had so many problems with it, especially in Linux, that I had to go back to core 200. I guess I could give it another try now..
fractile
 
Posts: 37
Joined: Wed Jun 07, 2006 2:26 pm

Re: Slider joint gets weak when moving away from origin

Postby Julio Jerez » Sun May 05, 2013 2:25 pm

But I have Linux working, and now I have the mac too.

try again, and try on a separate directory in case something goes wrong, must people who use Newton are in core 300 by now.
It makes too hard for me to maintain two separate releases.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Slider joint gets weak when moving away from origin

Postby fractile » Sun May 05, 2013 2:58 pm

Yes, I completely understand why you want to minimize maintenance on multiple branches.

First attempt at compiling version 3.05 in 64-bit Ubuntu stopped in a problem (which sounds very valid compiler error to me) already reported here:
viewtopic.php?f=26&t=7614

With SVN head I didn't get even that far:
Code: Select all
[  1%] Building CXX object CMakeFiles/Newton.dir/coreLibrary_300/source/core/dgSphere.cpp.o
In file included from /home/mikko/storage/downloads/newton-dynamics-read-only/coreLibrary_300/source/core/dgVector.h:28:0,
                 from /home/mikko/storage/downloads/newton-dynamics-read-only/coreLibrary_300/source/core/dgPlane.h:26,
                 from /home/mikko/storage/downloads/newton-dynamics-read-only/coreLibrary_300/source/core/dgSphere.cpp:24:
/home/mikko/storage/downloads/newton-dynamics-read-only/coreLibrary_300/source/core/dgSimd.h: In member function ‘dgSimd dgSimd::Floor() const’:
/home/mikko/storage/downloads/newton-dynamics-read-only/coreLibrary_300/source/core/dgSimd.h:179:4: error: request for member ‘m128_f32’ in ‘ret.dgSimd::m_type’, which is of non-class type ‘__m128 {aka __vector(4) float}’


Which version should I be using?
fractile
 
Posts: 37
Joined: Wed Jun 07, 2006 2:26 pm

Re: Slider joint gets weak when moving away from origin

Postby Julio Jerez » Sun May 05, 2013 3:31 pm

Temporarily try to comment pout this define

Code: Select all
#if !(defined (__USE_DOUBLE_PRECISION__) || defined (__ppc__) || defined (ANDROID) || defined (IOS) || defined (__APPLE__))
   #define DG_BUILD_SIMD_CODE
#endif
 


in file dgTypes.
I am going to put a new build as with the mac an Linux as soon as if resulve the issue with SVN and Google, right now I am blocked form making more commit because my quota run out
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Slider joint gets weak when moving away from origin

Postby Julio Jerez » Sun May 05, 2013 6:23 pm

Ok if you sync to svn I check in a version of dgSimd.h that resolve that syntax bug.

There are few compilers warning, do not worry about those fro now, I will fix then as soon as I can make a large check in in google SVN
It will have a running version of the sandbox in Linux and Mac
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Slider joint gets weak when moving away from origin

Postby corbingravely » Mon Apr 13, 2015 5:31 am

I still don’t get it. How does it get so weak. It can still maintain the strength, if the joints holding the slider joint is as strong as it should be. Maybe it would have the strength if we could provide a top strength as well.
corbingravely
 
Posts: 3
Joined: Thu Dec 04, 2014 7:25 am

Re: Slider joint gets weak when moving away from origin

Postby Julio Jerez » Mon Apr 13, 2015 9:21 am

was that a questing?
There are tow different topic going on here.

on the joint thong My guess is that he is placing the pivot of the joint at the origin of the world but the joint is fat away.
that will world academically, but in practice it will genera a lot of floating point degeneracy because there ill be very large torques canting each other.
the origin of a joint should be close to where the two bodies are.

In the case of a Joint connected to a fix body, the pivot should be close to the moving body.
These are just general guideline for good behavior.
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 6 guests

cron