All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SliderJoint.hh
Go to the documentation of this file.
1 /*
2  * Copyright 2012 Nate Koenig
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 /* Desc: A slider or primastic joint
18  * Author: Nate Koenig, Andrew Howard
19  * Date: 21 May 2003
20  */
21 
22 #ifndef _SLIDERJOINT_HH_
23 #define _SLIDERJOINT_HH_
24 
25 #include "gazebo/physics/Joint.hh"
26 
27 namespace gazebo
28 {
29  namespace physics
30  {
33 
36  template<class T>
37  class SliderJoint : public T
38  {
41  public: explicit SliderJoint(BasePtr _parent) : T(_parent)
42  {this->AddType(Base::SLIDER_JOINT);}
43 
45  public: virtual ~SliderJoint()
46  {}
47 
50  public: virtual void Load(sdf::ElementPtr _sdf)
51  {T::Load(_sdf);}
52 
54  public: virtual unsigned int GetAngleCount() const
55  {return 1;}
56 
60  public: virtual void SetAnchor(int _index, const math::Vector3 &_anchor);
61 
65  public: virtual math::Vector3 GetAnchor(int _index) const;
66 
69  };
71 
72  template<class T>
73  void SliderJoint<T>::SetAnchor(int /*_index*/, const math::Vector3 &_anchor)
74  {this->fakeAnchor = _anchor;}
75 
76  template<class T>
78  {return this->fakeAnchor;}
79  }
80 }
81 #endif