Bullet Collision Detection & Physics Library
btPointCollector.h
Go to the documentation of this file.
1 /*
2 Bullet Continuous Collision Detection and Physics Library
3 Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/
4 
5 This software is provided 'as-is', without any express or implied warranty.
6 In no event will the authors be held liable for any damages arising from the use of this software.
7 Permission is granted to anyone to use this software for any purpose,
8 including commercial applications, and to alter it and redistribute it freely,
9 subject to the following restrictions:
10 
11 1. 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.
12 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
13 3. 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
btPointCollector::setShapeIdentifiersA
virtual void setShapeIdentifiersA(int partId0, int index0)
setShapeIdentifiersA/B provides experimental support for per-triangle material / custom material comb...
Definition: btPointCollector.h:34
btScalar
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
Definition: btScalar.h:294
btPointCollector::setShapeIdentifiersB
virtual void setShapeIdentifiersB(int partId1, int index1)
Definition: btPointCollector.h:39
btDiscreteCollisionDetectorInterface::Result
Definition: btDiscreteCollisionDetectorInterface.h:29
btPointCollector::m_distance
btScalar m_distance
Definition: btPointCollector.h:25
BT_LARGE_FLOAT
#define BT_LARGE_FLOAT
Definition: btScalar.h:296
btDiscreteCollisionDetectorInterface.h
btPointCollector::m_pointInWorld
btVector3 m_pointInWorld
Definition: btPointCollector.h:24
btVector3
btVector3 can be used to represent 3D points and vectors.
Definition: btVector3.h:80
btPointCollector::btPointCollector
btPointCollector()
Definition: btPointCollector.h:29
btPointCollector::m_hasResult
bool m_hasResult
Definition: btPointCollector.h:27
btPointCollector::addContactPoint
virtual void addContactPoint(const btVector3 &normalOnBInWorld, const btVector3 &pointInWorld, btScalar depth)
Definition: btPointCollector.h:45
btPointCollector
Definition: btPointCollector.h:21
btPointCollector::m_normalOnBInWorld
btVector3 m_normalOnBInWorld
Definition: btPointCollector.h:23