mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-17 01:10:10 +00:00
506824cb9d
* Do not copy with allocations. * Remove unused DeepestNotMeContactTestResultCallback. * Avoid using pointers which should not be nullptr. * Move constructors implementation to headers. * Move types defined in .cpp are to unnamed namespace. * Comment unused arguments. * Avoid C-style casts.
34 lines
939 B
C++
34 lines
939 B
C++
#ifndef OPENMW_MWPHYSICS_CLOSESTNOTMERAYRESULTCALLBACK_H
|
|
#define OPENMW_MWPHYSICS_CLOSESTNOTMERAYRESULTCALLBACK_H
|
|
|
|
#include <span>
|
|
|
|
#include <BulletCollision/CollisionDispatch/btCollisionWorld.h>
|
|
|
|
class btCollisionObject;
|
|
|
|
namespace MWPhysics
|
|
{
|
|
class Projectile;
|
|
|
|
class ClosestNotMeRayResultCallback : public btCollisionWorld::ClosestRayResultCallback
|
|
{
|
|
public:
|
|
explicit ClosestNotMeRayResultCallback(const btCollisionObject* me, std::span<const btCollisionObject*> targets,
|
|
const btVector3& from, const btVector3& to)
|
|
: btCollisionWorld::ClosestRayResultCallback(from, to)
|
|
, mMe(me)
|
|
, mTargets(targets)
|
|
{
|
|
}
|
|
|
|
btScalar addSingleResult(btCollisionWorld::LocalRayResult& rayResult, bool normalInWorldSpace) override;
|
|
|
|
private:
|
|
const btCollisionObject* mMe;
|
|
const std::span<const btCollisionObject*> mTargets;
|
|
};
|
|
}
|
|
|
|
#endif
|