2020-03-30 18:45:38 +00:00
|
|
|
#ifndef OPENMW_MWPHYSICS_CLOSESTNOTMERAYRESULTCALLBACK_H
|
|
|
|
#define OPENMW_MWPHYSICS_CLOSESTNOTMERAYRESULTCALLBACK_H
|
|
|
|
|
2024-02-02 21:16:49 +00:00
|
|
|
#include <span>
|
2020-03-30 18:45:38 +00:00
|
|
|
|
|
|
|
#include <BulletCollision/CollisionDispatch/btCollisionWorld.h>
|
|
|
|
|
|
|
|
class btCollisionObject;
|
|
|
|
|
|
|
|
namespace MWPhysics
|
|
|
|
{
|
2020-10-31 13:01:14 +00:00
|
|
|
class Projectile;
|
|
|
|
|
2020-03-30 18:45:38 +00:00
|
|
|
class ClosestNotMeRayResultCallback : public btCollisionWorld::ClosestRayResultCallback
|
|
|
|
{
|
|
|
|
public:
|
2024-02-12 15:52:47 +00:00
|
|
|
explicit ClosestNotMeRayResultCallback(std::span<const btCollisionObject*> ignore,
|
|
|
|
std::span<const btCollisionObject*> targets, const btVector3& from, const btVector3& to)
|
2024-02-02 21:16:49 +00:00
|
|
|
: btCollisionWorld::ClosestRayResultCallback(from, to)
|
2024-02-12 15:52:47 +00:00
|
|
|
, mIgnoreList(ignore)
|
2024-02-02 21:16:49 +00:00
|
|
|
, mTargets(targets)
|
|
|
|
{
|
|
|
|
}
|
2020-03-30 18:45:38 +00:00
|
|
|
|
2020-10-16 18:18:54 +00:00
|
|
|
btScalar addSingleResult(btCollisionWorld::LocalRayResult& rayResult, bool normalInWorldSpace) override;
|
2021-01-07 10:02:53 +00:00
|
|
|
|
2020-03-30 18:45:38 +00:00
|
|
|
private:
|
2024-02-12 15:52:47 +00:00
|
|
|
const std::span<const btCollisionObject*> mIgnoreList;
|
2024-02-02 21:16:49 +00:00
|
|
|
const std::span<const btCollisionObject*> mTargets;
|
2020-03-30 18:45:38 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|