reactphysics3d
reactphysics3d copied to clipboard
SphereCast?
Hello, is there any way doing something like sphereCast(radius, startPoint, endPoint, &castCallback)?
I mean you can try to simulate it using capsule overlap but you'll get wrong contact points then
Usecase - moving object wants to cast against wall to move until it and stop. It's not like CCD because we don't need to check time of collision between 2 moving objects, we need cast between static and dynamic object (exactly wide raycast)
(the only solution I've found so far is binary search on the way doing overlap several times but it is costly and not so accurate. You can optimize it doing capsule overlap then finding collision point then doing several sphere overlap tests until you find maximum distance to collision)
Hello,
I think that what you need is called 'sweep test' but this kind of queries are not supported yet in the library.
Any plans adding this in near future?
Also what can I use instead of sweep test for now?
Any plans adding this in near future?
Maybe not in the next release v1.0.0 (next 6 months) but probably in the next one v1.1.0. I am not really sure yet.
Also what can I use instead of sweep test for now?
Maybe you can try to use the PhysicsWorld::testOverlap(...) methods that test overlap between shapes where one shape could be your sphere and you test this sphere at several position along a line. That's not perfect of course.