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

GjkPairDetector.h « NarrowPhaseCollision « Bullet « bullet « extern - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: f6311a9eba5d4e94dd3f52a40b715c6ac9f756bc (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
/*
 * Copyright (c) 2005 Erwin Coumans http://continuousphysics.com/Bullet/
 *
 * 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 GJK_PAIR_DETECTOR_H
#define GJK_PAIR_DETECTOR_H

#include "DiscreteCollisionDetectorInterface.h"
#include "SimdPoint3.h"

#include "CollisionMargin.h"

class ConvexShape;
#include "SimplexSolverInterface.h"
class ConvexPenetrationDepthSolver;

/// GjkPairDetector uses GJK to implement the DiscreteCollisionDetectorInterface
class GjkPairDetector : public DiscreteCollisionDetectorInterface
{
	

	SimdVector3	m_cachedSeparatingAxis;
	ConvexPenetrationDepthSolver*	m_penetrationDepthSolver;
	SimplexSolverInterface* m_simplexSolver;
	ConvexShape* m_minkowskiA;
	ConvexShape* m_minkowskiB;

public:

	GjkPairDetector(ConvexShape* objectA,ConvexShape* objectB,SimplexSolverInterface* simplexSolver,ConvexPenetrationDepthSolver*	penetrationDepthSolver);
	virtual ~GjkPairDetector() {};

	virtual void	GetClosestPoints(const ClosestPointInput& input,Result& output);

	void SetMinkowskiA(ConvexShape* minkA)
	{
		m_minkowskiA = minkA;
	}

	void SetMinkowskiB(ConvexShape* minkB)
	{
		m_minkowskiB = minkB;
	}
	void SetCachedSeperatingAxis(const SimdVector3& seperatingAxis)
	{
		m_cachedSeparatingAxis = seperatingAxis;
	}

	void	SetPenetrationDepthSolver(ConvexPenetrationDepthSolver*	penetrationDepthSolver)
	{
		m_penetrationDepthSolver = penetrationDepthSolver;
	}
};

#endif //GJK_PAIR_DETECTOR_H