NewtonCollisionCollideContinue for collision detection..

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

NewtonCollisionCollideContinue for collision detection..

Postby Aaron » Sun Oct 19, 2008 8:25 pm

I'm using the NewtonCollisionCollideContinue() function in newton 2.0 (beta 14) and although it seems to work most of the time, it appears to not report collisions some times and I also have an input parameter and an output parameter which seem a little screwey...

The only objects in my scene are a sphere (which moves around) and a stationary mesh (TreeCollision).

First off, what value should I be passing in for "timestep" ?
If my current sphere position is "A", and I want to check for collisions when traveling between position "A" and position "B", I pass in "A" for the current position (in the matrixA parameter), I pass in "B-A" for the velocity (in the velocA parameter), and I'm using 1.0 for the timestep parameter, which I think is correct.... but if I pass in 0.0001 or 1000.0 for the timestep parameter it seems to give exactly the same result(?)

Second, when I've tried with just two spheres colliding in the past the "timeOfImpact" parameter that's returned seemed to contain a valid result, but when testing collisions between my sphere and my mesh it always returns 1.0000000e+010 in this parameter, whether it finds a collision or not... is this the expected behaviour?

The two cases I'm finding where the function seems to report collisions incorrectly are as follows:

Given two positions, "A" and "B", (where "B" is quite close to the surface), and using the function in the way I described above, if I move the sphere from position "A" to position "B" it reports no collisions, but then if I test for moving from position "B" back to position "A" it reports a collision.. Any thoughts on why this might be happening?

The other case that's giving me real headaches at the moment is that I have positions "A", "B", and "C", and a plane runs between them with "A" and "B" on one side and "C" on the other, ("A" and "B" are quite close to the plane, while "C" is a bit further away). Moving from "A" to "C" reports a collision, moving from "A" to "B" does not report a collision, but moving from "B" to "C" also does not report a collision.

Does anyone have any experience with this, or ideas on what I might be doing wrong?
Aaron
 
Posts: 8
Joined: Tue Feb 19, 2008 7:18 pm

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 3 guests

cron