Bullet Collision Detection & Physics Library: btContactProcessing.h Source File

Bullet Collision Detection & Physics Library

btContactProcessing.h
Go to the documentation of this file.
1#ifndef BT_CONTACT_H_INCLUDED
2#define BT_CONTACT_H_INCLUDED
3
7/*
8This source file is part of GIMPACT Library.
9
10For the latest info, see http://gimpact.sourceforge.net/
11
12Copyright (c) 2007 Francisco Leon Najera. C.C. 80087371.
13email: projectileman@yahoo.com
14
15
16This software is provided 'as-is', without any express or implied warranty.
17In no event will the authors be held liable for any damages arising from the use of this software.
18Permission is granted to anyone to use this software for any purpose,
19including commercial applications, and to alter it and redistribute it freely,
20subject to the following restrictions:
21
221. 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.
232. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
243. This notice may not be removed or altered from any source distribution.
25*/
26
27#include "LinearMath/btTransform.h"
28#include "LinearMath/btAlignedObjectArray.h"
29#include "btTriangleShapeEx.h"
30#include "btContactProcessingStructs.h"
31
32 class btContactArray : public btAlignedObjectArray<GIM_CONTACT>
33{
34public:
35 btContactArray()
36 {
37 reserve(64);
38 }
39
40 SIMD_FORCE_INLINE void push_contact(
41 const btVector3 &point, const btVector3 &normal,
42 btScalar depth, int feature1, int feature2)
43 {
44 push_back(GIM_CONTACT(point, normal, depth, feature1, feature2));
45 }
46
47 SIMD_FORCE_INLINE void push_triangle_contacts(
48 const GIM_TRIANGLE_CONTACT &tricontact,
49 int feature1, int feature2)
50 {
51 for (int i = 0; i < tricontact.m_point_count; i++)
52 {
53 push_contact(
54 tricontact.m_points[i],
55 tricontact.m_separating_normal,
56 tricontact.m_penetration_depth, feature1, feature2);
57 }
58 }
59
60 void merge_contacts(const btContactArray &contacts, bool normal_contact_average = true);
61
62 void merge_contacts_unique(const btContactArray &contacts);
63};
64
65#endif // GIM_CONTACT_H_INCLUDED
btAlignedObjectArray.h
btContactProcessingStructs.h
btScalar
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
Definition btScalar.h:314
SIMD_FORCE_INLINE
#define SIMD_FORCE_INLINE
Definition btScalar.h:98
btTransform.h
btTriangleShapeEx.h
GIM_CONTACT
The GIM_CONTACT is an internal GIMPACT structure, similar to btManifoldPoint.
Definition btContactProcessingStructs.h:41
btAlignedObjectArray< GIM_CONTACT >::push_back
void push_back(const GIM_CONTACT &_Val)
Definition btAlignedObjectArray.h:257
btAlignedObjectArray< GIM_CONTACT >::reserve
void reserve(int _Count)
Definition btAlignedObjectArray.h:280
btAlignedObjectArray< GIM_CONTACT >::btAlignedObjectArray
btAlignedObjectArray()
Definition btAlignedObjectArray.h:121
btContactArray
Definition btContactProcessing.h:33
btContactArray::push_contact
void push_contact(const btVector3 &point, const btVector3 &normal, btScalar depth, int feature1, int feature2)
Definition btContactProcessing.h:40
btContactArray::push_triangle_contacts
void push_triangle_contacts(const GIM_TRIANGLE_CONTACT &tricontact, int feature1, int feature2)
Definition btContactProcessing.h:47
btContactArray::merge_contacts_unique
void merge_contacts_unique(const btContactArray &contacts)
Definition btContactProcessing.cpp:145
btContactArray::merge_contacts
void merge_contacts(const btContactArray &contacts, bool normal_contact_average=true)
Definition btContactProcessing.cpp:65
btContactArray::btContactArray
btContactArray()
Definition btContactProcessing.h:35
btVector3
btVector3 can be used to represent 3D points and vectors.
Definition btVector3.h:82
GIM_TRIANGLE_CONTACT
Structure for collision.
Definition btTriangleShapeEx.h:37
GIM_TRIANGLE_CONTACT::m_points
btVector3 m_points[MAX_TRI_CLIPPING]
Definition btTriangleShapeEx.h:41
GIM_TRIANGLE_CONTACT::m_penetration_depth
btScalar m_penetration_depth
Definition btTriangleShapeEx.h:38
GIM_TRIANGLE_CONTACT::m_separating_normal
btVector4 m_separating_normal
Definition btTriangleShapeEx.h:40
GIM_TRIANGLE_CONTACT::m_point_count
int m_point_count
Definition btTriangleShapeEx.h:39