mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-03-01 16:39:40 +00:00
Visualize hand to hand hits
This commit is contained in:
parent
435b2e37f8
commit
574ccbf7bd
3 changed files with 6 additions and 0 deletions
|
@ -39,6 +39,7 @@ namespace MWPhysics
|
|||
mObject = collisionObject;
|
||||
mLeastDistSqr = distsqr;
|
||||
mContactPoint = cp.getPositionWorldOnA();
|
||||
mContactNormal = cp.m_normalWorldOnB;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -20,6 +20,7 @@ namespace MWPhysics
|
|||
public:
|
||||
const btCollisionObject *mObject{nullptr};
|
||||
btVector3 mContactPoint{0,0,0};
|
||||
btVector3 mContactNormal{0,0,0};
|
||||
btScalar mLeastDistSqr;
|
||||
|
||||
DeepestNotMeContactTestResultCallback(const btCollisionObject* me, const std::vector<const btCollisionObject*>& targets, const btVector3 &origin);
|
||||
|
|
|
@ -173,6 +173,7 @@ namespace MWPhysics
|
|||
|
||||
if (result.mHit)
|
||||
{
|
||||
reportCollision(Misc::Convert::toBullet(result.mHitPos), Misc::Convert::toBullet(result.mHitNormal));
|
||||
return std::make_pair(result.mHitObject, result.mHitPos);
|
||||
}
|
||||
|
||||
|
@ -217,7 +218,10 @@ namespace MWPhysics
|
|||
{
|
||||
PtrHolder* holder = static_cast<PtrHolder*>(resultCallback.mObject->getUserPointer());
|
||||
if (holder)
|
||||
{
|
||||
reportCollision(resultCallback.mContactPoint, resultCallback.mContactNormal);
|
||||
return std::make_pair(holder->getPtr(), Misc::Convert::toOsg(resultCallback.mContactPoint));
|
||||
}
|
||||
}
|
||||
return std::make_pair(MWWorld::Ptr(), osg::Vec3f());
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue