-
Hello all, I am just starting to learn about PhysX 5.0 and have been trying out some of the features that will be relevant to my application. I need to use PhysX for collision detection and distance measurement. For testing collision detection, I loaded a octomap file (.bt) by reading in each leaf voxel as a box primitive into a scene and then running a overlap scene query against a test sphere. This test returned expected results, specifically that the sphere was in fact in collision with one of the voxels/box primitives. Here is the code I used for that:
Now I wanted to go to the next step which was distance computation for which I figured I would need broadphase as a first step to calculate which voxels are closest to the sphere. For that I wrote this:
As you can see the sphere is placed at the same location as the last one and has the same size. However, I always see the following output:
i.e. The number of created pairs and deleted pairs are both 0. Is there something wrong I am doing in the setup? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 15 replies
-
Isn't it because of the duplicate updates?
The results are incremental so if nothing changes between the two updates, the number of "created pairs" will be zero indeed (it will be non-zero after the first update, not after the second one). |
Beta Was this translation helpful? Give feedback.
Thank you so much for all the help. So I found the issue was that I was calling aabb_manager->fetchResults(results) after aabb_manager->update(results). I guess that replaces the results that the update call was providing as no voxel had moved, thus no new pairs were created. However, calling aabb_manager->fetchResults(results) after aabb_manager->update() [NOTE the empty function argument], gives the expected output.
This solves the problem.
Tldr: Don't call fetchResults after update(results). Only call fetchResults after update().