JoltPhysics3D: Add RaycastQuery and RaycastQueryFirst

This commit is contained in:
SirLynix
2023-03-25 13:53:44 +01:00
committed by Jérôme Leclercq
parent 707a486e74
commit b3595178a1
6 changed files with 134 additions and 34 deletions

View File

@@ -47,7 +47,8 @@ namespace Nz
inline bool IsBodyActive(UInt32 bodyIndex) const;
bool RaycastQueryFirst(const Vector3f& from, const Vector3f& to, RaycastHit* hitInfo = nullptr);
bool RaycastQuery(const Vector3f& from, const Vector3f& to, const FunctionRef<std::optional<float>(const RaycastHit& hitInfo)>& callback);
bool RaycastQueryFirst(const Vector3f& from, const Vector3f& to, const FunctionRef<void(const RaycastHit& hitInfo)>& callback);
void SetGravity(const Vector3f& gravity);
void SetMaxStepCount(std::size_t maxStepCount);
@@ -63,7 +64,6 @@ namespace Nz
float fraction;
JoltRigidBody3D* hitBody = nullptr;
Vector3f hitPosition;
Vector3f hitNormal;
};
private: