A place to discuss everything related to Newton Dynamics.
Moderators: Sascha Willems, walaber
by derdragon » Tue Feb 17, 2009 12:56 pm
I just recently upgraded from Newton 1.53 to 2.0, and I've been working out the differences in my code. I can't seem to see what's wrong with my TreeCollision, however, and I'm thinking I might be using the wrong lib/dll. Currently I'm using the ones in \NewtonWin-2.00\sdk\x32\dll_vs7. I don't know if this is correct though. I've also linked JointLibrary.lib and copied it's DLL to my exe's directory as well, since I included JointLibrary.h after getting errors about joint functions missing.
When objects collide with a treecollision body, occasionally they will randomly fly off at a high speed, spinning. Sometimes right through the tree collision itself. If I make a large cube and give it a mass of 0, objects collide with it and behave just as I'd expect them to without any problems. I read a thread that said to download the latest version, but as far as I know, the version in the announcement IS the latest version, and that's what I downloaded.
Any help would be appreciated! Thanks!
-
derdragon
-
- Posts: 13
- Joined: Fri Aug 03, 2007 12:56 pm
by Julio Jerez » Tue Feb 17, 2009 1:51 pm
the version in the announcement is the latest.
you need to implement debug display to see if the collision is correct.
-
Julio Jerez
- Moderator
-
- Posts: 12249
- Joined: Sun Sep 14, 2003 2:18 pm
- Location: Los Angeles
-
by derdragon » Wed Feb 18, 2009 10:08 am
Julio, I think I may have found the issue, which I'm assuming is a bug... This problem only seems to occur when I have two collision triangles back to back. I found this by outputting the normals of the collisions, and found that some of my objects, when falling, were colliding with a resulting normal of (0,-1,0), which would be in the same direction as gravity, rather than pointing against the direction of motion, like it should have been. I'm assuming the check for triangles was finding the triangles with downward facing normals before the ones with upward facing normals, and just threw out the upward ones since it had determined them to be the same distance. I can do a hacky workaround for now, and just shift my triangles slightly in the direction of their normals, but this IS hacky. At least I know I've got it compiling right. Thanks again!
-
derdragon
-
- Posts: 13
- Joined: Fri Aug 03, 2007 12:56 pm
by agi_shi » Wed Feb 18, 2009 12:51 pm
It's not a bug. Julio has mentioned in the past to not have any back to back polygons because it's hard to determine which face the actual collision occurred with. Julio can explain it better.
-
agi_shi
-
- Posts: 263
- Joined: Fri Aug 17, 2007 6:54 pm
by Julio Jerez » Wed Feb 18, 2009 2:27 pm
yes that is correct meshes are single sided.
This was soppoes to be teh case on 1.53 and older but for soem reason it workrd on some circuntance.
The fact tha was working marginally it dis no mean it was correct, it was not and I bet you it is th reason of soem colliion problem soe people see an dteh balme of teh collsion system.
In conclusion In the Newton SDK there is not way to have a polygonal mesh be double sided. and adding a double faces will make the engine malfuntion in umpredicatble ways.
-
Julio Jerez
- Moderator
-
- Posts: 12249
- Joined: Sun Sep 14, 2003 2:18 pm
- Location: Los Angeles
-
by derdragon » Wed Feb 18, 2009 2:54 pm
Hmm, alright, I guess I'll just have to use my workaround then, though seems like you could just throw out the "backfaces" when determining collisions. Whatever, I'm not going to complain too much, it's an excellent engine
and very useful for my purposes. Thanks!
-
derdragon
-
- Posts: 13
- Joined: Fri Aug 03, 2007 12:56 pm
Return to General Discussion
Who is online
Users browsing this forum: No registered users and 19 guests