gzBtUniversalConstraint.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012-2016 Open Source Robotics Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17 #ifndef _GAZEBO_BULLET_UNIVERSAL_CONSTRAINT_
18 #define _GAZEBO_BULLET_UNIVERSAL_CONSTRAINT_
19 
21 
22 ATTRIBUTE_ALIGNED16(class) gzBtUniversalConstraint
23 : public btGeneric6DofConstraint
24 {
25  public: BT_DECLARE_ALIGNED_ALLOCATOR();
26 
34  public: gzBtUniversalConstraint(
35  btRigidBody &_rbA,
36  btRigidBody &_rbB,
37  const btVector3 &_anchor,
38  const btVector3 &_axis1,
39  const btVector3 &_axis2);
40 
47  public: gzBtUniversalConstraint(
48  btRigidBody &_rbA,
49  const btVector3 &_anchor,
50  const btVector3 &_axis1,
51  const btVector3 &_axis2);
52 
55  public: const btVector3 &getAnchor();
56 
59  public: const btVector3 &getAnchor2();
60 
63  public: const btVector3 &getAxis1();
64 
67  public: const btVector3 &getAxis2();
68 
71  public: btScalar getAngle1();
72 
75  public: btScalar getAngle2();
76 
80  public: void getUpperLimit(btScalar &_ang1max, btScalar &_ang2max);
81 
85  public: void getLowerLimit(btScalar &_ang1min, btScalar &_ang2min);
86 
90  public: void setUpperLimit(btScalar _ang1max, btScalar _ang2max);
91 
95  public: void setLowerLimit(btScalar _ang1min, btScalar _ang2min);
96 
100  public: void setAxis(const btVector3 &_axis1, const btVector3 &_axis2);
101 
105  public: btScalar getMaxMotorImpulse1() const;
106 
110  public: btScalar getMaxMotorImpulse2() const;
111 
115  public: void setMaxMotorImpulse1(btScalar _i);
116 
120  public: void setMaxMotorImpulse2(btScalar _i);
121 
123  protected: btVector3 m_anchor;
124 
126  protected: btVector3 m_axis1;
127 
129  protected: btVector3 m_axis2;
130 
132  private: btScalar maxMotorImpulse[2];
133 };
134 
135 #endif