[dali_2.3.21] Merge branch 'devel/master'
[platform/core/uifw/dali-toolkit.git] / dali-physics / third-party / bullet3 / src / Bullet3Dynamics / ConstraintSolver / b3SolverConstraint.h
1 /*
2 Bullet Continuous Collision Detection and Physics Library
3 Copyright (c) 2003-2006 Erwin Coumans  https://bulletphysics.org
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 B3_SOLVER_CONSTRAINT_H
17 #define B3_SOLVER_CONSTRAINT_H
18
19 #include "Bullet3Common/b3Vector3.h"
20 #include "Bullet3Common/b3Matrix3x3.h"
21 //#include "b3JacobianEntry.h"
22 #include "Bullet3Common/b3AlignedObjectArray.h"
23
24 //#define NO_FRICTION_TANGENTIALS 1
25 #include "b3SolverBody.h"
26
27 ///1D constraint along a normal axis between bodyA and bodyB. It can be combined to solve contact and friction constraints.
28 B3_ATTRIBUTE_ALIGNED16(struct)
29 b3SolverConstraint
30 {
31         B3_DECLARE_ALIGNED_ALLOCATOR();
32
33         b3Vector3 m_relpos1CrossNormal;
34         b3Vector3 m_contactNormal;
35
36         b3Vector3 m_relpos2CrossNormal;
37         //b3Vector3             m_contactNormal2;//usually m_contactNormal2 == -m_contactNormal
38
39         b3Vector3 m_angularComponentA;
40         b3Vector3 m_angularComponentB;
41
42         mutable b3SimdScalar m_appliedPushImpulse;
43         mutable b3SimdScalar m_appliedImpulse;
44         int m_padding1;
45         int m_padding2;
46         b3Scalar m_friction;
47         b3Scalar m_jacDiagABInv;
48         b3Scalar m_rhs;
49         b3Scalar m_cfm;
50
51         b3Scalar m_lowerLimit;
52         b3Scalar m_upperLimit;
53         b3Scalar m_rhsPenetration;
54         union {
55                 void* m_originalContactPoint;
56                 b3Scalar m_unusedPadding4;
57         };
58
59         int m_overrideNumSolverIterations;
60         int m_frictionIndex;
61         int m_solverBodyIdA;
62         int m_solverBodyIdB;
63
64         enum b3SolverConstraintType
65         {
66                 B3_SOLVER_CONTACT_1D = 0,
67                 B3_SOLVER_FRICTION_1D
68         };
69 };
70
71 typedef b3AlignedObjectArray<b3SolverConstraint> b3ConstraintArray;
72
73 #endif  //B3_SOLVER_CONSTRAINT_H