Bullet Collision Detection & Physics Library
btPointCollector.h
Go to the documentation of this file.
1/*
2Bullet Continuous Collision Detection and Physics Library
3Copyright (c) 2003-2006 Erwin Coumans https://bulletphysics.org
4
5This software is provided 'as-is', without any express or implied warranty.
6In no event will the authors be held liable for any damages arising from the use of this software.
7Permission is granted to anyone to use this software for any purpose,
8including commercial applications, and to alter it and redistribute it freely,
9subject to the following restrictions:
10
111. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
122. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
133. This notice may not be removed or altered from any source distribution.
14*/
15
16#ifndef BT_POINT_COLLECTOR_H
17#define BT_POINT_COLLECTOR_H
18
20
22{
25 btScalar m_distance; //negative means penetration
26
28
31 {
32 }
33
34 virtual void setShapeIdentifiersA(int partId0, int index0)
35 {
36 (void)partId0;
37 (void)index0;
38 }
39 virtual void setShapeIdentifiersB(int partId1, int index1)
40 {
41 (void)partId1;
42 (void)index1;
43 }
44
45 virtual void addContactPoint(const btVector3& normalOnBInWorld, const btVector3& pointInWorld, btScalar depth)
46 {
47 if (depth < m_distance)
48 {
49 m_hasResult = true;
50 m_normalOnBInWorld = normalOnBInWorld;
51 m_pointInWorld = pointInWorld;
52 //negative means penetration
53 m_distance = depth;
54 }
55 }
56};
57
58#endif //BT_POINT_COLLECTOR_H
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
Definition: btScalar.h:314
#define BT_LARGE_FLOAT
Definition: btScalar.h:316
btVector3 can be used to represent 3D points and vectors.
Definition: btVector3.h:82
virtual void setShapeIdentifiersB(int partId1, int index1)
btVector3 m_normalOnBInWorld
virtual void setShapeIdentifiersA(int partId0, int index0)
setShapeIdentifiersA/B provides experimental support for per-triangle material / custom material comb...
btVector3 m_pointInWorld
virtual void addContactPoint(const btVector3 &normalOnBInWorld, const btVector3 &pointInWorld, btScalar depth)