All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RayShape.hh
Go to the documentation of this file.
1 /*
2  * Copyright 2011 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 ray
18  * Author: Nate Koenig
19  * Date: 14 Oct 2009
20 */
21 
22 #ifndef RAYSHAPE_HH
23 #define RAYSHAPE_HH
24 
25 #include <float.h>
26 #include <string>
27 
28 #include "physics/PhysicsTypes.hh"
29 #include "physics/Shape.hh"
30 
31 namespace gazebo
32 {
33  namespace physics
34  {
37 
39  class RayShape : public Shape
40  {
42  public: RayShape(PhysicsEnginePtr _physicsEngine);
43 
48  public: RayShape(CollisionPtr parent);
49 
51  public: virtual ~RayShape();
52 
57  public: virtual void SetPoints(const math::Vector3 &posStart,
58  const math::Vector3 &posEnd);
59 
60 
64  public: virtual void GetRelativePoints(math::Vector3 &posA,
65  math::Vector3 &posB);
66 
70  public: virtual void GetGlobalPoints(math::Vector3 &posA,
71  math::Vector3 &posB);
72 
75  public: virtual void SetLength(double len);
76 
78  public: double GetLength() const;
79 
81  public: virtual void Update() = 0;
82 
84  public: virtual void GetIntersection(double &_dist,
85  std::string &_entity) = 0;
86 
88  public: void SetRetro(float retro);
89 
91  public: float GetRetro() const;
92 
94  public: void SetFiducial(int fid);
95 
97  public: int GetFiducial() const;
98 
100  public: virtual void Init();
101 
102  public: void FillMsg(msgs::Geometry &) {}
103 
104  public: virtual void ProcessMsg(const msgs::Geometry &) {}
107  protected: double contactLen;
108  protected: double contactRetro;
109  protected: int contactFiducial;
110 
114 
118  };
120  }
121 }
122 #endif
123 
124