mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-01 03:21:41 +00:00
506824cb9d
* 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.
34 lines
887 B
C++
34 lines
887 B
C++
#ifndef OPENMW_MWPHYSICS_CONTACTTESTRESULTCALLBACK_H
|
|
#define OPENMW_MWPHYSICS_CONTACTTESTRESULTCALLBACK_H
|
|
|
|
#include <vector>
|
|
|
|
#include <BulletCollision/CollisionDispatch/btCollisionWorld.h>
|
|
|
|
#include "physicssystem.hpp"
|
|
|
|
class btCollisionObject;
|
|
struct btCollisionObjectWrapper;
|
|
|
|
namespace MWPhysics
|
|
{
|
|
class ContactTestResultCallback : public btCollisionWorld::ContactResultCallback
|
|
{
|
|
public:
|
|
explicit ContactTestResultCallback(const btCollisionObject* testedAgainst)
|
|
: mTestedAgainst(testedAgainst)
|
|
{
|
|
}
|
|
|
|
btScalar addSingleResult(btManifoldPoint& cp, const btCollisionObjectWrapper* col0Wrap, int partId0, int index0,
|
|
const btCollisionObjectWrapper* col1Wrap, int partId1, int index1) override;
|
|
|
|
std::vector<ContactPoint> mResult;
|
|
|
|
private:
|
|
const btCollisionObject* mTestedAgainst;
|
|
};
|
|
}
|
|
|
|
#endif
|