2020-03-30 18:39:10 +00:00
|
|
|
#ifndef OPENMW_MWPHYSICS_DEEPESTNOTMECONTACTTESTRESULTCALLBACK_H
|
|
|
|
#define OPENMW_MWPHYSICS_DEEPESTNOTMECONTACTTESTRESULTCALLBACK_H
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
#include <BulletCollision/CollisionDispatch/btCollisionWorld.h>
|
|
|
|
|
2020-03-30 21:25:33 +00:00
|
|
|
class btCollisionObject;
|
|
|
|
|
2020-03-30 18:39:10 +00:00
|
|
|
namespace MWPhysics
|
|
|
|
{
|
|
|
|
class DeepestNotMeContactTestResultCallback : public btCollisionWorld::ContactResultCallback
|
|
|
|
{
|
|
|
|
const btCollisionObject* mMe;
|
|
|
|
const std::vector<const btCollisionObject*> mTargets;
|
|
|
|
|
|
|
|
// Store the real origin, since the shape's origin is its center
|
|
|
|
btVector3 mOrigin;
|
|
|
|
|
|
|
|
public:
|
|
|
|
const btCollisionObject* mObject{ nullptr };
|
|
|
|
btVector3 mContactPoint{ 0, 0, 0 };
|
2020-10-26 12:40:56 +00:00
|
|
|
btVector3 mContactNormal{ 0, 0, 0 };
|
2020-03-30 18:39:10 +00:00
|
|
|
btScalar mLeastDistSqr;
|
|
|
|
|
|
|
|
DeepestNotMeContactTestResultCallback(
|
|
|
|
const btCollisionObject* me, const std::vector<const btCollisionObject*>& targets, const btVector3& origin);
|
|
|
|
|
|
|
|
btScalar addSingleResult(btManifoldPoint& cp, const btCollisionObjectWrapper* col0Wrap, int partId0, int index0,
|
2020-10-16 18:18:54 +00:00
|
|
|
const btCollisionObjectWrapper* col1Wrap, int partId1, int index1) override;
|
2020-03-30 18:39:10 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|