Re: [Algorithms] Kinematic Collision
Brought to you by:
vexxed72
|
From: David B. <db...@fa...> - 2009-09-04 16:38:07
|
>>>> Yes, I agree with that. That's why we exposed a set of functions to test exactly this (if a given position is valid), However it puts the power (or the burden, depending on your point of view) in the hands of users: -they- have to test for valid positions. At the time we felt that it was more efficient than running the "useless" depenetration code automatically all the time. The only problem with PhysX is that the queries to test for valid positions only return a boolean answer (position is valid or not). When it is not, the depenetration vector is not provided. So it is not as useful as it could be. (Boolean queries are a lot faster and often enough, so that was the reason IIRC). - Pierre <<<< Requiring a seperate query to test for initial intersection seems very wasteful, since you are going to have to traverse the broadphase/midphase structures twice as often as otherwise. Not to mention the maths that would have been saved by providing the result with the sweep query. Also I think the depenetration vector is the important part... I guess you could perform some sort of binary search to depenetrate but that seems error prone and expensive. I dont think it is terribly difficult to provide depenetration results, the way I do it is detect initial penetration and if detected compute the direction of least penetration and perform another sweep(with just the relevant parts of the objects) to determine the depentration distance. It probably amounts to 50 lines of code per sweep test, which could be easily disabled with a flag if not needed. David -- http://www.fastmail.fm - Send your email first class |