2021-01-07 10:02:53 +00:00
|
|
|
#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:
|
2024-02-02 21:16:49 +00:00
|
|
|
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)
|
|
|
|
{
|
|
|
|
}
|
2021-01-07 10:02:53 +00:00
|
|
|
|
|
|
|
btScalar addSingleResult(btCollisionWorld::LocalConvexResult& result, bool normalInWorldSpace) override;
|
|
|
|
|
|
|
|
private:
|
2021-08-05 08:55:19 +00:00
|
|
|
const btCollisionObject* mCaster;
|
2021-01-07 10:02:53 +00:00
|
|
|
const btCollisionObject* mMe;
|
2024-02-02 21:16:49 +00:00
|
|
|
Projectile& mProjectile;
|
2021-01-07 10:02:53 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|