godot_collision_dispatcher.h 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /*************************************************************************/
  2. /* godot_collision_dispatcher.h */
  3. /* Author: AndreaCatania */
  4. /*************************************************************************/
  5. /* This file is part of: */
  6. /* GODOT ENGINE */
  7. /* http://www.godotengine.org */
  8. /*************************************************************************/
  9. /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
  10. /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
  11. /* */
  12. /* Permission is hereby granted, free of charge, to any person obtaining */
  13. /* a copy of this software and associated documentation files (the */
  14. /* "Software"), to deal in the Software without restriction, including */
  15. /* without limitation the rights to use, copy, modify, merge, publish, */
  16. /* distribute, sublicense, and/or sell copies of the Software, and to */
  17. /* permit persons to whom the Software is furnished to do so, subject to */
  18. /* the following conditions: */
  19. /* */
  20. /* The above copyright notice and this permission notice shall be */
  21. /* included in all copies or substantial portions of the Software. */
  22. /* */
  23. /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
  24. /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
  25. /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
  26. /* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
  27. /* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
  28. /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
  29. /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
  30. /*************************************************************************/
  31. #ifndef GODOT_COLLISION_DISPATCHER_H
  32. #define GODOT_COLLISION_DISPATCHER_H
  33. #include "int_types.h"
  34. #include <btBulletDynamicsCommon.h>
  35. /// This class is required to implement custom collision behaviour in the narrowphase
  36. class GodotCollisionDispatcher : public btCollisionDispatcher {
  37. private:
  38. static const int CASTED_TYPE_AREA;
  39. public:
  40. GodotCollisionDispatcher(btCollisionConfiguration *collisionConfiguration);
  41. virtual bool needsCollision(const btCollisionObject *body0, const btCollisionObject *body1);
  42. virtual bool needsResponse(const btCollisionObject *body0, const btCollisionObject *body1);
  43. };
  44. #endif