[dali_2.3.21] Merge branch 'devel/master'
[platform/core/uifw/dali-toolkit.git] / dali-physics / third-party / bullet3 / src / Bullet3Collision / NarrowPhaseCollision / b3ConvexUtility.h
1
2 /*
3 Copyright (c) 2012 Advanced Micro Devices, Inc.  
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 //Originally written by Erwin Coumans
16
17 #ifndef _BT_CONVEX_UTILITY_H
18 #define _BT_CONVEX_UTILITY_H
19
20 #include "Bullet3Common/b3AlignedObjectArray.h"
21 #include "Bullet3Common/b3Transform.h"
22
23 struct b3MyFace
24 {
25         b3AlignedObjectArray<int> m_indices;
26         b3Scalar m_plane[4];
27 };
28
29 B3_ATTRIBUTE_ALIGNED16(class)
30 b3ConvexUtility
31 {
32 public:
33         B3_DECLARE_ALIGNED_ALLOCATOR();
34
35         b3Vector3 m_localCenter;
36         b3Vector3 m_extents;
37         b3Vector3 mC;
38         b3Vector3 mE;
39         b3Scalar m_radius;
40
41         b3AlignedObjectArray<b3Vector3> m_vertices;
42         b3AlignedObjectArray<b3MyFace> m_faces;
43         b3AlignedObjectArray<b3Vector3> m_uniqueEdges;
44
45         b3ConvexUtility()
46         {
47         }
48         virtual ~b3ConvexUtility();
49
50         bool initializePolyhedralFeatures(const b3Vector3* orgVertices, int numVertices, bool mergeCoplanarTriangles = true);
51
52         void initialize();
53         bool testContainment() const;
54 };
55 #endif