btDbvt::collideOCL (and KDOP) documentation
Posted: Fri Oct 28, 2011 2:45 pm
Hi all,
I am trying to make sense of the frustum culling feature of btDbvt (the collideOCL and collideKDOP functions). I am looking at the single implementation I can find using it in the BulletSAPCompleteBoxPruningTest.cpp file (found in the Extras/CDTestFramework) as reference but as I read elsewhere here on the forum it's not written to be a properly documented example.
I nearly got it working now, but I'm struggling with the back-to-front sorting which fails (reverses) depending on the rotation of my frustum and I think I probably defined something wrong somewhere.
Both the code in the example and in btDbvt itself is completely written without any usable comments or documentation, which is a real shame. I've successfully used this tree in a couple of interesting ways now and it is extremely useful, I just wish it was better documented. I spend a lot of time trying to figure it out based on the usage elsewhere in Bullet.
If anyone can share some more information on this topic it would be great!
- How exactly is the definition of the normal and offset arrays in the collideOCL/collideKDOP functions? (ok, normals of the frustum planes, but should the normals point in or out, for example? Offset from what?)
- What does KDOP and OCL stand for?
- Can any number of planes be defined or is just 4 or 5 allowed?
- Is the sort axis algorithm in btDbvt::collideOCL tested properly (widespread use in games etc), or can there still be bugs with the sorting algorithm?
- Also is there any documentation on which functions in btDbvt::ICollide should be implemented or not depending on the usage? In my case I only re-implemented Process(const btDbvtNode*).
- What does btDbvt::collideTU do?
- How often should the optimize-functions be called? Which one of the 3 is recommended, what are the trade-offs? Must the optimize-functions be called to get correct results, or do they just improve the query performance?
Best regards,
Ola
I am trying to make sense of the frustum culling feature of btDbvt (the collideOCL and collideKDOP functions). I am looking at the single implementation I can find using it in the BulletSAPCompleteBoxPruningTest.cpp file (found in the Extras/CDTestFramework) as reference but as I read elsewhere here on the forum it's not written to be a properly documented example.
I nearly got it working now, but I'm struggling with the back-to-front sorting which fails (reverses) depending on the rotation of my frustum and I think I probably defined something wrong somewhere.
Both the code in the example and in btDbvt itself is completely written without any usable comments or documentation, which is a real shame. I've successfully used this tree in a couple of interesting ways now and it is extremely useful, I just wish it was better documented. I spend a lot of time trying to figure it out based on the usage elsewhere in Bullet.
If anyone can share some more information on this topic it would be great!
- How exactly is the definition of the normal and offset arrays in the collideOCL/collideKDOP functions? (ok, normals of the frustum planes, but should the normals point in or out, for example? Offset from what?)
- What does KDOP and OCL stand for?
- Can any number of planes be defined or is just 4 or 5 allowed?
- Is the sort axis algorithm in btDbvt::collideOCL tested properly (widespread use in games etc), or can there still be bugs with the sorting algorithm?
- Also is there any documentation on which functions in btDbvt::ICollide should be implemented or not depending on the usage? In my case I only re-implemented Process(const btDbvtNode*).
- What does btDbvt::collideTU do?
- How often should the optimize-functions be called? Which one of the 3 is recommended, what are the trade-offs? Must the optimize-functions be called to get correct results, or do they just improve the query performance?
Best regards,
Ola