jrouwe / JoltPhysics

A multi core friendly rigid body physics and collision detection library. Written in C++. Suitable for games and VR applications. Used by Horizon Forbidden West.
MIT License
6.42k stars 414 forks source link

Is it possible to cast sphere ? #1070

Closed ChivenZhang closed 4 months ago

ChivenZhang commented 4 months ago

I am wrapping jolt physics into my project according to unity api doc. It's turns out that there's no way to do sphere-cast. I want to know wether it is possible to do that. Thansk. This is api from unity doc: image

This is api from jolt: image

DocAce commented 4 months ago

Yes, it's possible. Use GetNarrowPhaseQuery().CastShape() and pass in a sphere shape.

ChivenZhang commented 4 months ago

Yeah, I just found it in the sample project by using api "CastShape". Ok, thansk.