summaryrefslogtreecommitdiffhomepage
path: root/Opcode/OPC_Picking.h
blob: fa5dfc0ddc0357df3a382ef195932279f9783f58 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
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 IcePoint& view_point, CullModeCallback callback, void* user_data);
#endif

#endif //__OPC_PICKING_H__