1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-01 03:21:41 +00:00
OpenMW/apps/openmw/mwphysics/projectileconvexcallback.hpp
elsid 506824cb9d
Cleanup physics callbacks
* 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.
2024-02-07 22:04:34 +01:00

34 lines
971 B
C++

#ifndef OPENMW_MWPHYSICS_PROJECTILECONVEXCALLBACK_H
#define OPENMW_MWPHYSICS_PROJECTILECONVEXCALLBACK_H
#include <BulletCollision/CollisionDispatch/btCollisionWorld.h>
class btCollisionObject;
namespace MWPhysics
{
class Projectile;
class ProjectileConvexCallback : public btCollisionWorld::ClosestConvexResultCallback
{
public:
explicit ProjectileConvexCallback(const btCollisionObject* caster, const btCollisionObject* me,
const btVector3& from, const btVector3& to, Projectile& projectile)
: btCollisionWorld::ClosestConvexResultCallback(from, to)
, mCaster(caster)
, mMe(me)
, mProjectile(projectile)
{
}
btScalar addSingleResult(btCollisionWorld::LocalConvexResult& result, bool normalInWorldSpace) override;
private:
const btCollisionObject* mCaster;
const btCollisionObject* mMe;
Projectile& mProjectile;
};
}
#endif