mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-10 06:39:49 +00:00
1f4c85520f
imprecision issue with projectile collision detection. Simplify the mechanics: manage hits in one spot. Give magic projectiles a collision shape similar in size to their visible model. Rename the 2 convex result callback to clearly state their purpose.
28 lines
784 B
C++
28 lines
784 B
C++
#ifndef OPENMW_MWPHYSICS_CLOSESTNOTMERAYRESULTCALLBACK_H
|
|
#define OPENMW_MWPHYSICS_CLOSESTNOTMERAYRESULTCALLBACK_H
|
|
|
|
#include <vector>
|
|
|
|
#include <BulletCollision/CollisionDispatch/btCollisionWorld.h>
|
|
|
|
class btCollisionObject;
|
|
|
|
namespace MWPhysics
|
|
{
|
|
class Projectile;
|
|
|
|
class ClosestNotMeRayResultCallback : public btCollisionWorld::ClosestRayResultCallback
|
|
{
|
|
public:
|
|
ClosestNotMeRayResultCallback(const btCollisionObject* me, std::vector<const btCollisionObject*> targets, const btVector3& from, const btVector3& to);
|
|
|
|
btScalar addSingleResult(btCollisionWorld::LocalRayResult& rayResult, bool normalInWorldSpace) override;
|
|
|
|
private:
|
|
const btCollisionObject* mMe;
|
|
const std::vector<const btCollisionObject*> mTargets;
|
|
};
|
|
}
|
|
|
|
#endif
|