mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-09 12:42:11 +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.
26 lines
757 B
C++
26 lines
757 B
C++
#ifndef OPENMW_MWPHYSICS_ACTORCONVEXCALLBACK_H
|
|
#define OPENMW_MWPHYSICS_ACTORCONVEXCALLBACK_H
|
|
|
|
#include <BulletCollision/CollisionDispatch/btCollisionWorld.h>
|
|
|
|
class btCollisionObject;
|
|
|
|
namespace MWPhysics
|
|
{
|
|
class ActorConvexCallback : public btCollisionWorld::ClosestConvexResultCallback
|
|
{
|
|
public:
|
|
ActorConvexCallback(const btCollisionObject *me, const btVector3 &motion, btScalar minCollisionDot, const btCollisionWorld * world);
|
|
|
|
btScalar addSingleResult(btCollisionWorld::LocalConvexResult& convexResult,bool normalInWorldSpace) override;
|
|
|
|
protected:
|
|
const btCollisionObject *mMe;
|
|
const btVector3 mMotion;
|
|
const btScalar mMinCollisionDot;
|
|
const btCollisionWorld * mWorld;
|
|
};
|
|
}
|
|
|
|
#endif
|