A place to discuss everything related to Newton Dynamics.
Moderators: Sascha Willems, walaber
by godlike » Mon Apr 03, 2017 3:27 pm
NewtonSceneCollisionSetSubCollisionMatrix used to work with matrices that have scale. Now there is a check in dgCollisionInstance::SetLocalMatrix that expects a det equal to 1.0. Did I miss something?
-
godlike
-
- Posts: 58
- Joined: Sun Mar 16, 2014 3:48 am
-
by Julio Jerez » Mon Apr 03, 2017 4:31 pm
is probably a hold over from something I did not test yet, indeed it should work with scale, there is a demo that apply global scale for compounds.
what code line is that?
-
Julio Jerez
- Moderator
-
- Posts: 12249
- Joined: Sun Sep 14, 2003 2:18 pm
- Location: Los Angeles
-
by godlike » Tue Apr 04, 2017 4:28 am
Hi Julio,
The assertion happens in dgCollisionInstance.cpp:436
A simple reprocase which adds uniform scale to a matrix can be found here:
https://pastebin.com/d4LWRHpX
-
godlike
-
- Posts: 58
- Joined: Sun Mar 16, 2014 3:48 am
-
by Julio Jerez » Tue Apr 04, 2017 7:17 am
Oh I see, you want to apply a scale to shapes individually.
I do not remember that newton working with scaled matrices, maybe so but it was a difficult an expensive.
but you are right it should support the scale of sub shapes by applying it to the matrix which makes a nice and easy interface.
It is easy to fix, I will do it today
Thank for the repro.
-
Julio Jerez
- Moderator
-
- Posts: 12249
- Joined: Sun Sep 14, 2003 2:18 pm
- Location: Los Angeles
-
by Julio Jerez » Tue Apr 04, 2017 7:49 am
ok it Is fixed now.
-
Julio Jerez
- Moderator
-
- Posts: 12249
- Joined: Sun Sep 14, 2003 2:18 pm
- Location: Los Angeles
-
by godlike » Tue Apr 04, 2017 9:28 am
Thanks for the fix. That worked!
I'm hitting another assertion now though. There is a dAssert(0) in dgCollisionScene.cpp:145. Removing it doesn't seem to cause problems but I'm not sure.
Here is my back-trace
https://pastebin.com/UMVSWzbX. Unfortunately I wasn't able to reproduce this in one of the Newton's demos.
-
godlike
-
- Posts: 58
- Joined: Sun Mar 16, 2014 3:48 am
-
by Julio Jerez » Tue Apr 04, 2017 10:40 am
that assert in ok to remove locally. It is an optimization specific to newton 3.14
basically newton 3.14 does no uses trivial rejection test, instead it uses the closest distance from the last collision test as a conservative estimate of how far apart the shapes are.
The problem is that the code need to be implemented on all shapes. I added it to almost all except
two: scene collision and Heightfield, which currently both return zero, making the broad phase call the low lever each time the AABB of a pair is overlapping.
is a nice and sophisticated trick but required highly accurate closest distance calculation and lot of low lever implementation detail for non convex shapes.
you can comment it out locally, until I get to do the implementation.
-
Julio Jerez
- Moderator
-
- Posts: 12249
- 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 7 guests