summaryrefslogtreecommitdiffhomepage
path: root/Opcode/OPC_Picking.h
diff options
context:
space:
mode:
authorFWoltermann@gmail.com <FWoltermann@gmail.com@076cb2c4-205e-83fd-5cf3-1be9aa105544>2011-12-08 14:53:40 +0000
committerFWoltermann@gmail.com <FWoltermann@gmail.com@076cb2c4-205e-83fd-5cf3-1be9aa105544>2011-12-08 14:53:40 +0000
commite33e19d0587146859d48a134ec9fd94e7b7ba5cd (patch)
tree69d048c8801858d2756ab3a487090a7a1b74bf14 /Opcode/OPC_Picking.h
downloadstarshatter-e33e19d0587146859d48a134ec9fd94e7b7ba5cd.zip
starshatter-e33e19d0587146859d48a134ec9fd94e7b7ba5cd.tar.gz
starshatter-e33e19d0587146859d48a134ec9fd94e7b7ba5cd.tar.bz2
Initial upload
Diffstat (limited to 'Opcode/OPC_Picking.h')
-rw-r--r--Opcode/OPC_Picking.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/Opcode/OPC_Picking.h b/Opcode/OPC_Picking.h
new file mode 100644
index 0000000..74a87b2
--- /dev/null
+++ b/Opcode/OPC_Picking.h
@@ -0,0 +1,45 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+/*
+ * OPCODE - Optimized Collision Detection
+ * Copyright (C) 2001 Pierre Terdiman
+ * Homepage: http://www.codercorner.com/Opcode.htm
+ */
+///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+/**
+ * Contains code to perform "picking".
+ * \file OPC_Picking.h
+ * \author Pierre Terdiman
+ * \date March, 20, 2001
+ */
+///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+// Include Guard
+#ifndef __OPC_PICKING_H__
+#define __OPC_PICKING_H__
+
+#ifdef OPC_RAYHIT_CALLBACK
+
+ enum CullMode
+ {
+ CULLMODE_NONE = 0,
+ CULLMODE_CW = 1,
+ CULLMODE_CCW = 2
+ };
+
+ typedef CullMode (*CullModeCallback)(udword triangle_index, void* user_data);
+
+ OPCODE_API bool SetupAllHits (RayCollider& collider, CollisionFaces& contacts);
+ OPCODE_API bool SetupClosestHit (RayCollider& collider, CollisionFace& closest_contact);
+ OPCODE_API bool SetupShadowFeeler (RayCollider& collider);
+ OPCODE_API bool SetupInOutTest (RayCollider& collider);
+
+ OPCODE_API bool Picking(
+ CollisionFace& picked_face,
+ const Ray& world_ray, const Model& model, const Matrix4x4* world,
+ float min_dist, float max_dist, const Point& view_point, CullModeCallback callback, void* user_data);
+#endif
+
+#endif //__OPC_PICKING_H__ \ No newline at end of file