1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-11-07 19:32:49 +01:00
openrw/rwengine/include/dynamics/RaycastCallbacks.hpp
2015-04-04 20:00:59 +01:00

23 lines
691 B
C++

#pragma once
#include <bullet/btBulletDynamicsCommon.h>
/**
* Implements raycast callback that ignores a specified btCollisionObject
*/
class ClosestNotMeRayResultCallback : public btCollisionWorld::ClosestRayResultCallback
{
btCollisionObject* _self;
public:
ClosestNotMeRayResultCallback( btCollisionObject* self, const btVector3& from, const btVector3& to )
: ClosestRayResultCallback( from, to ), _self( self ) {}
virtual btScalar addSingleResult(btCollisionWorld::LocalRayResult &rayResult, bool normalInWorldSpace)
{
if( rayResult.m_collisionObject == _self ) {
return 1.0;
}
return ClosestRayResultCallback::addSingleResult( rayResult, normalInWorldSpace );
}
};