I have a friend maintaining UPBGE - (a fork of blender game engine running in blender 2.9x)
I was wondering what the name of the batched raycast system was under the hood so we can wrap it / more information about it for upbge
note- we are building using bullet 2.83
Batched raycasting wrapper in C
-
- Posts: 849
- Joined: Tue Sep 30, 2014 6:03 pm
- Location: San Francisco
Re: Batched raycasting wrapper in C
By "batched" which one of these do you mean:?
(1) "One raycast against the whole (batched) world of objects"
(2) "A batch of raycasts against the whole world of objects"
Item (1) does exist as a feature of the BulletPhysics API. Item (2) does not.
Item (1) is done through btCollisionWorld::rayTest(). You have to supply a (typically custom) RayResultCallback implementation which "does what you want" whenever the ray hits something.
I downloaded what I think is a more recent copy of UPBGE. All of the "physics" stuff I could find was in python. Under the hood Bullet is truly C++ but there is a python wrapper. You might try asking in the PyBullet Support and Feedback forum.
(1) "One raycast against the whole (batched) world of objects"
(2) "A batch of raycasts against the whole world of objects"
Item (1) does exist as a feature of the BulletPhysics API. Item (2) does not.
Item (1) is done through btCollisionWorld::rayTest(). You have to supply a (typically custom) RayResultCallback implementation which "does what you want" whenever the ray hits something.
I downloaded what I think is a more recent copy of UPBGE. All of the "physics" stuff I could find was in python. Under the hood Bullet is truly C++ but there is a python wrapper. You might try asking in the PyBullet Support and Feedback forum.
-
- Posts: 47
- Joined: Sun Oct 27, 2013 4:16 am
Re: Batched raycasting wrapper in C
This seems to indicate otherwise*
viewtopic.php?f=18&t=1907&view=next
viewtopic.php?t=3790
viewtopic.php?f=18&t=1907&view=next
viewtopic.php?t=3790
""Interesting, I didn't know about this. Look in the Benchmark and ConcaveRaycast demos for #ifdef BATCH_RAYCASTER
I guess you'll have to define that before you can see how it works. Note that this isn't going to make raycasting threadsafe. It looks like it uses a thread barrier to perform raycasts in a large batch, thus the name.
Top
-
- Posts: 849
- Joined: Tue Sep 30, 2014 6:03 pm
- Location: San Francisco
Re: Batched raycasting wrapper in C
Hrm...
True, there is an #ifdef BATCH_RAYCASTER inside examples/Heightfield/HeightfieldExample.cpp however I don't see any evidence it actually works... in Bullet 2.88 because it relies on a gBatchRaycaster being a valid pointer but there is no code that actually declares or sets it. AFAICT: if you were to define BATCH_RAYCASTER then the example would fail to compile. That code appears to be cruft.
I rolled back to 2.83 to see. The example code there is more complete. In one of the Demos gBatchRaycaster points to an SpuBatchRaycaster instance, however I cannot find the actual implementation of that class. I can only conclude: at the 2.83 release the "batch raycaster" is cruft but has suffered less bitrot.
I'm just trying to be helpful. I certainly don't want to discourage you from finding the information you seek. Unfortunately: I couldn't find the information you are looking for. Good luck.
True, there is an #ifdef BATCH_RAYCASTER inside examples/Heightfield/HeightfieldExample.cpp however I don't see any evidence it actually works... in Bullet 2.88 because it relies on a gBatchRaycaster being a valid pointer but there is no code that actually declares or sets it. AFAICT: if you were to define BATCH_RAYCASTER then the example would fail to compile. That code appears to be cruft.
I rolled back to 2.83 to see. The example code there is more complete. In one of the Demos gBatchRaycaster points to an SpuBatchRaycaster instance, however I cannot find the actual implementation of that class. I can only conclude: at the 2.83 release the "batch raycaster" is cruft but has suffered less bitrot.
I'm just trying to be helpful. I certainly don't want to discourage you from finding the information you seek. Unfortunately: I couldn't find the information you are looking for. Good luck.
-
- Posts: 47
- Joined: Sun Oct 27, 2013 4:16 am
Re: Batched raycasting wrapper in C
it appears to be earlier than that even - it's in the release notes for 2.67