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 | |
---|
17 | #include "btTypedConstraint.h" |
---|
18 | #include "BulletDynamics/Dynamics/btRigidBody.h" |
---|
19 | |
---|
20 | static btRigidBody s_fixed(0, 0,0); |
---|
21 | |
---|
22 | btTypedConstraint::btTypedConstraint(btTypedConstraintType type) |
---|
23 | :m_userConstraintType(-1), |
---|
24 | m_userConstraintId(-1), |
---|
25 | m_constraintType (type), |
---|
26 | m_rbA(s_fixed), |
---|
27 | m_rbB(s_fixed), |
---|
28 | m_appliedImpulse(btScalar(0.)) |
---|
29 | { |
---|
30 | s_fixed.setMassProps(btScalar(0.),btVector3(btScalar(0.),btScalar(0.),btScalar(0.))); |
---|
31 | } |
---|
32 | btTypedConstraint::btTypedConstraint(btTypedConstraintType type, btRigidBody& rbA) |
---|
33 | :m_userConstraintType(-1), |
---|
34 | m_userConstraintId(-1), |
---|
35 | m_constraintType (type), |
---|
36 | m_rbA(rbA), |
---|
37 | m_rbB(s_fixed), |
---|
38 | m_appliedImpulse(btScalar(0.)) |
---|
39 | { |
---|
40 | s_fixed.setMassProps(btScalar(0.),btVector3(btScalar(0.),btScalar(0.),btScalar(0.))); |
---|
41 | |
---|
42 | } |
---|
43 | |
---|
44 | |
---|
45 | btTypedConstraint::btTypedConstraint(btTypedConstraintType type, btRigidBody& rbA,btRigidBody& rbB) |
---|
46 | :m_userConstraintType(-1), |
---|
47 | m_userConstraintId(-1), |
---|
48 | m_constraintType (type), |
---|
49 | m_rbA(rbA), |
---|
50 | m_rbB(rbB), |
---|
51 | m_appliedImpulse(btScalar(0.)) |
---|
52 | { |
---|
53 | s_fixed.setMassProps(btScalar(0.),btVector3(btScalar(0.),btScalar(0.),btScalar(0.))); |
---|
54 | |
---|
55 | } |
---|
56 | |
---|