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 2012 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 /* 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 <string>
26 
28 #include "gazebo/physics/Shape.hh"
29 
30 namespace gazebo
31 {
32  namespace physics
33  {
36 
39  class RayShape : public Shape
40  {
43  public: explicit RayShape(PhysicsEnginePtr _physicsEngine);
44 
47  public: explicit RayShape(CollisionPtr _parent);
48 
50  public: virtual ~RayShape();
51 
56  public: virtual void SetPoints(const math::Vector3 &_posStart,
57  const math::Vector3 &_posEnd);
58 
59 
63  public: virtual void GetRelativePoints(math::Vector3 &_posA,
64  math::Vector3 &_posB);
65 
69  public: virtual void GetGlobalPoints(math::Vector3 &_posA,
70  math::Vector3 &_posB);
71 
74  public: virtual void SetLength(double _len);
75 
78  public: double GetLength() const;
79 
81  public: virtual void SetScale(const math::Vector3 &_scale);
82 
84  public: virtual void Update() = 0;
85 
89  public: virtual void GetIntersection(double &_dist,
90  std::string &_entity) = 0;
91 
94  public: void SetRetro(float _retro);
95 
98  public: float GetRetro() const;
99 
102  public: void SetFiducial(int _fid);
103 
106  public: int GetFiducial() const;
107 
109  public: virtual void Init();
110 
114  public: void FillMsg(msgs::Geometry &_msg);
115 
119  public: virtual void ProcessMsg(const msgs::Geometry &_msg);
120 
121  // Contact information; this is filled out during collision
122  // detection.
124  protected: double contactLen;
126  protected: double contactRetro;
128  protected: int contactFiducial;
129 
134 
137 
140  };
142  }
143 }
144 #endif