Welcome to mirror list, hosted at ThFree Co, Russian Federation.

CollisionDispatcher.h « BroadphaseCollision « Bullet « bullet « extern - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 7787ed417c50b2d664d2682de20c581bdc85d1ef (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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/*
 * Copyright (c) 2005 Erwin Coumans http://www.erwincoumans.com
 *
 * Permission to use, copy, modify, distribute and sell this software
 * and its documentation for any purpose is hereby granted without fee,
 * provided that the above copyright notice appear in all copies.
 * Erwin Coumans makes no representations about the suitability 
 * of this software for any purpose.  
 * It is provided "as is" without express or implied warranty.
*/
#ifndef COLLISION_DISPATCHER_H
#define COLLISION_DISPATCHER_H

class CollisionAlgorithm;
struct BroadphaseProxy;
class RigidBody;

enum CollisionDispatcherId
{
	RIGIDBODY_DISPATCHER = 0,
	RAGDOLL_DISPATCHER
};

class PersistentManifold;

struct DispatcherInfo
{
	enum DispatchFunc
	{
		DISPATCH_DISCRETE = 1,
		DISPATCH_CONTINUOUS
	};
	DispatcherInfo()
		:m_dispatchFunc(DISPATCH_DISCRETE),
		m_timeOfImpact(1.f),
		m_useContinuous(false)
	{

	}
	float	m_timeStep;
	int		m_stepCount;
	int		m_dispatchFunc;
	float	m_timeOfImpact;
	bool	m_useContinuous;
	
};

/// Collision Dispatcher can be used in combination with broadphase and collision algorithms.
class Dispatcher
{


public:
	virtual ~Dispatcher() ;

	virtual CollisionAlgorithm* FindAlgorithm(BroadphaseProxy& proxy0,BroadphaseProxy& proxy1) = 0;

	//
	// asume dispatchers to have unique id's in the range [0..max dispacher]
	//
	virtual int GetUniqueId() = 0;

	virtual PersistentManifold*	GetNewManifold(void* body0,void* body1)=0;

	virtual void ReleaseManifold(PersistentManifold* manifold)=0;


};


#endif //COLLISION_DISPATCHER_H