A place to discuss everything related to Newton Dynamics.
Moderators: Sascha Willems, walaber
by pHySiQuE » Tue Sep 03, 2013 9:25 pm
It appears that NewtonCollisionClosestPoint is never returning 0 (for intersection tests) even when the distance between the closest two points is extremely small. I don't know why, because this was previously working.
Last edited by
pHySiQuE on Thu Sep 05, 2013 1:30 am, edited 1 time in total.
-
pHySiQuE
-
- Posts: 608
- Joined: Fri Sep 02, 2011 9:54 pm
by Julio Jerez » Tue Sep 03, 2013 10:23 pm
collision closest point does not return zero, in newton 300. It used to in newton 200
In the past it use to return zero when the two shape where interpenetrating, with core 300 it always returns the closet distance.
the penetration behavior is now an end user thing.
the function return point p, point q and a normal.
to determine interpenetration you can perform this test
- Code: Select all
dist = dostProduct ((q - P), normnal)
if (dist < 0.0) {
//shapes are interpenetrating. here you can assume return zero
}
-
Julio Jerez
- Moderator

-
- Posts: 12426
- Joined: Sun Sep 14, 2003 2:18 pm
- Location: Los Angeles
-
by pHySiQuE » Wed Sep 04, 2013 2:20 pm
With my sphere test, your code above works correctly. However, when I try getting the closest point with a collision tree I get these huge numbers. The large wall the player is going into is being tested against.

- Image4.jpg (105.26 KiB) Viewed 1768 times
-
pHySiQuE
-
- Posts: 608
- Joined: Fri Sep 02, 2011 9:54 pm
by Julio Jerez » Wed Sep 04, 2013 2:32 pm
are you tyry to calculated close point on a collision tree vs anoteh collsio tree?
I do not think that works and has never being supported by newton, that's is not a trivial operations.
are you try to call close point between a convex object and a collision tree?
I do not remeber if that works, or has even worked. It looks like it should since the collesion tree is made of convex polygons.
can you provide a test so that I can try?
-
Julio Jerez
- Moderator

-
- Posts: 12426
- Joined: Sun Sep 14, 2003 2:18 pm
- Location: Los Angeles
-
by pHySiQuE » Wed Sep 04, 2013 3:29 pm
It's a cylinder and collision tree.
-
pHySiQuE
-
- Posts: 608
- Joined: Fri Sep 02, 2011 9:54 pm
by pHySiQuE » Wed Sep 04, 2013 3:57 pm
Ah, that doesn't make sense, since a collision tree has no volume.
Okay, I just fixed it so I am using a convex hull for those trigger volumes. Problem solved.
(The reason I am doing an intersection test and not simple collision is because this is for volumetric trigger fields, where the trigger will continually be activated when the player is inside it.)
-
pHySiQuE
-
- Posts: 608
- Joined: Fri Sep 02, 2011 9:54 pm
Return to General Discussion
Who is online
Users browsing this forum: No registered users and 1 guest