2
0

OPC_Picking.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  2. /*
  3. * OPCODE - Optimized Collision Detection
  4. * Copyright (C) 2001 Pierre Terdiman
  5. * Homepage: http://www.codercorner.com/Opcode.htm
  6. */
  7. ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  8. ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  9. /**
  10. * Contains code to perform "picking".
  11. * \file OPC_Picking.h
  12. * \author Pierre Terdiman
  13. * \date March, 20, 2001
  14. */
  15. ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  16. ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  17. // Include Guard
  18. #ifndef __OPC_PICKING_H__
  19. #define __OPC_PICKING_H__
  20. #ifdef OPC_RAYHIT_CALLBACK
  21. enum CullMode
  22. {
  23. CULLMODE_NONE = 0,
  24. CULLMODE_CW = 1,
  25. CULLMODE_CCW = 2
  26. };
  27. typedef CullMode (*CullModeCallback)(udword triangle_index, void* user_data);
  28. OPCODE_API bool SetupAllHits (RayCollider& collider, CollisionFaces& contacts);
  29. OPCODE_API bool SetupClosestHit (RayCollider& collider, CollisionFace& closest_contact);
  30. OPCODE_API bool SetupShadowFeeler (RayCollider& collider);
  31. OPCODE_API bool SetupInOutTest (RayCollider& collider);
  32. OPCODE_API bool Picking(
  33. CollisionFace& picked_face,
  34. const Ray& world_ray, const Model& model, const Matrix4x4* world,
  35. float min_dist, float max_dist, const Point& view_point, CullModeCallback callback, void* user_data);
  36. #endif
  37. #endif //__OPC_PICKING_H__