NewtonBodySetCollisionScale and offset

Report any bugs here and we'll post fixes

Moderators: Sascha Willems, Thomas

Re: NewtonBodySetCollisionScale and offset

Postby arkeon » Fri Sep 19, 2014 4:09 am

Here is very demonstrative sample showing the scale issue.

http://arkeon.dyndns.org/scol/physicscale.rar
(compiled with newton dlls in debug)

The box on left :
- ground have a box shape and is scaled.
- the spheres on it have continuous collision enable.
- each sphere have a different initial size and is then scaled

The box on middle :
- ground have a collision tree shape and is scaled.
- each sphere have a different initial size and is then scaled

The box on right (1:1 for reference):
- ground have a collision tree shape with no scale (1:1 ratio).
- each sphere have no scale (1:1 ratio).

all the spheres have the same mass and size, and no special material used.
the sphere diameter in world is 1.02 meter.
arkeon
 
Posts: 261
Joined: Sat Sep 13, 2014 5:25 pm

Re: NewtonBodySetCollisionScale and offset

Postby Julio Jerez » Fri Sep 19, 2014 6:50 am

maybe I did not explained correctly the first or second time, so here it goes again.
you make the demos too complicated, I can see the problem but you make the demo so difficult to debug.

can you just make the demo that exposes the problem but that has one box an one sphere.
if you have more than one case then make one executable exposing each case.
a demo with dozen of object is to hard to isolated where the problem is.
Julio Jerez
Moderator
Moderator
 
Posts: 11039
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: NewtonBodySetCollisionScale and offset

Postby arkeon » Fri Sep 19, 2014 7:40 am

ok sorry ^^

just replace the scaled.xos file in the partition/demos/debugphysic directory

http://arkeon.dyndns.org/scol/scaled.xos
arkeon
 
Posts: 261
Joined: Sat Sep 13, 2014 5:25 pm

Re: NewtonBodySetCollisionScale and offset

Postby Julio Jerez » Fri Sep 19, 2014 8:50 am

excellent that's much better for debugging.

now let me see what is wrong.
Julio Jerez
Moderator
Moderator
 
Posts: 11039
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: NewtonBodySetCollisionScale and offset

Postby Julio Jerez » Fri Sep 19, 2014 10:57 am

Ok this is fixed now.
please sync and try again
Julio Jerez
Moderator
Moderator
 
Posts: 11039
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: NewtonBodySetCollisionScale and offset

Postby arkeon » Fri Sep 19, 2014 10:59 am

great :) Thanks !
arkeon
 
Posts: 261
Joined: Sat Sep 13, 2014 5:25 pm

Re: NewtonBodySetCollisionScale and offset

Postby arkeon » Fri Sep 19, 2014 12:19 pm

Strange I still have strange behavior on 3 spheres in the demos I sent to you first.
did you test again with the full cases demo from the rar file ?
arkeon
 
Posts: 261
Joined: Sat Sep 13, 2014 5:25 pm

Re: NewtonBodySetCollisionScale and offset

Postby Julio Jerez » Fri Sep 19, 2014 12:37 pm

yes after I fixed wit the small demo I test with the original demo and is worked.

I just did it again and all 18 sphere land corretly on the floor.

the second road have 6 sphere wit radios for
1, 10, 5, 10, 25, 50

scales
1, 0.1, 0.05, 0.02, 0.01

and all worked correctly, the bug was on file
C:\Development\newton-dynamics\coreLibrary_300\source\physics\dgCollisionMesh.cpp
line 100, it should look like this now
Code: Select all
         //m_posit += matrix.RotateVector (collision->GetObbOrigin().CompProduct4(m_objCollision->GetScale()));
         //m_size = collision->GetObbSize().CompProduct4(m_objCollision->GetScale()) + dgCollisionInstance::m_padding;
         m_posit += matrix.RotateVector (collision->GetObbOrigin().CompProduct4(m_invScale));
         m_size = collision->GetObbSize().CompProduct4(m_invScale) + dgCollisionInstance::m_padding;
 

sync again and try, and if still fail upload the demo.
Julio Jerez
Moderator
Moderator
 
Posts: 11039
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: NewtonBodySetCollisionScale and offset

Postby arkeon » Fri Sep 19, 2014 12:55 pm

sync again and the problem still here.
The ball on the middle collision tree
and the three scaled balls on left of the box collision are bouncing much more. while all the other seems good.

I upload the demo again.
arkeon
 
Posts: 261
Joined: Sat Sep 13, 2014 5:25 pm

Re: NewtonBodySetCollisionScale and offset

Postby arkeon » Fri Sep 19, 2014 1:20 pm

You can donwload it again : http://arkeon.dyndns.org/scol/physicscale.rar

a good thing I understood : if I take this same sphere and move it another place it don't react the same. so this is related to the position in the world or on the collided shape.

maybe it could be related to contact calculation ?
I have another sample where I get an exception in CalculateConvexToNonConvexContacts at dgSqrt (angularSpeedBound);
arkeon
 
Posts: 261
Joined: Sat Sep 13, 2014 5:25 pm

Re: NewtonBodySetCollisionScale and offset

Postby Julio Jerez » Fri Sep 19, 2014 4:59 pm

what is the problem now?
I just downloaded the link and I see all the balls colliding at the surface of the Box beneath them
Julio Jerez
Moderator
Moderator
 
Posts: 11039
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: NewtonBodySetCollisionScale and offset

Postby arkeon » Fri Sep 19, 2014 5:05 pm

strange for me there are 4 ball that bounce a lot more than the others where they should stabilize at the same time of the others.

As I says before it depend of the ball position on X Z.
I'll make a video if you want.
arkeon
 
Posts: 261
Joined: Sat Sep 13, 2014 5:25 pm

Re: NewtonBodySetCollisionScale and offset

Postby arkeon » Fri Sep 19, 2014 6:18 pm

On the video above, as you can see :
- there is several balls that take much time to stabilize and that bounce.
- then I change the ground shape from box to tree collision and get the same result as the middle one
- the convex collision do almost the same as the box one.
- then I mode the middle ball that bounce abnormally on the tree collision. and as you can see depending of the position the result change.

arkeon
 
Posts: 261
Joined: Sat Sep 13, 2014 5:25 pm

Re: NewtonBodySetCollisionScale and offset

Postby Julio Jerez » Fri Sep 19, 2014 6:18 pm

I suspect this is due to the large scale factor that you are using.
can you make a test with one ball that is supposed to settled but keeps bouncing,
like the other one you made?
Julio Jerez
Moderator
Moderator
 
Posts: 11039
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: NewtonBodySetCollisionScale and offset

Postby arkeon » Fri Sep 19, 2014 6:24 pm

you can replace the same file as before with this one :
http://arkeon.dyndns.org/scol/scaled.xos
arkeon
 
Posts: 261
Joined: Sat Sep 13, 2014 5:25 pm

PreviousNext

Return to Bugs and Fixes

Who is online

Users browsing this forum: No registered users and 1 guest