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

PointCollector.h « NarrowPhaseCollision « Bullet « bullet « extern - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: f39fa090ae49db912fca41a94da3dd020c4e0a73 (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
#ifndef POINT_COLLECTOR_H
#define POINT_COLLECTOR_H

#include "DiscreteCollisionDetectorInterface.h"



struct PointCollector : public DiscreteCollisionDetectorInterface::Result
{
	
	
	SimdVector3 m_normalOnBInWorld;
	SimdVector3 m_pointInWorld;
	SimdScalar	m_distance;//negative means penetration

	bool	m_hasResult;

	PointCollector () 
		: m_hasResult(false),m_distance(1e30f)
	{
	}

	virtual void AddContactPoint(const SimdVector3& normalOnBInWorld,const SimdVector3& pointInWorld,float depth)
	{
		if (depth< m_distance)
		{
			m_hasResult = true;
			m_normalOnBInWorld = normalOnBInWorld;
			m_pointInWorld = pointInWorld;
			//negative means penetration
			m_distance = depth;
		}
	}
};

#endif //POINT_COLLECTOR_H