Ignition Rendering

API Reference

4.1.0
RayQuery.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2017 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 IGNITION_RENDERING_RAYQUERY_HH_
18 #define IGNITION_RENDERING_RAYQUERY_HH_
19 
20 #include <ignition/math/Vector3.hh>
21 
22 #include "ignition/rendering/config.hh"
26 
27 namespace ignition
28 {
29  namespace rendering
30  {
31  inline namespace IGNITION_RENDERING_VERSION_NAMESPACE {
32  //
34  class IGNITION_RENDERING_VISIBLE RayQueryResult
35  {
37  public: double distance = -1;
38 
41 
43  public: unsigned int objectId = 0;
44 
46  public: operator bool()
47  {
48  return distance > 0;
49  }
50  };
51 
54  class IGNITION_RENDERING_VISIBLE RayQuery
55  : public virtual Object
56  {
58  public: virtual ~RayQuery() { }
59 
62  public: virtual void SetOrigin(const math::Vector3d &_origin) = 0;
63 
66  public: virtual math::Vector3d Origin() const = 0;
67 
70  public: virtual void SetDirection(const math::Vector3d &_dir) = 0;
71 
74  public: virtual math::Vector3d Direction() const = 0;
75 
79  public: virtual void SetFromCamera(const CameraPtr &_camera,
80  const math::Vector2d &_coord) = 0;
81 
85  public: virtual RayQueryResult ClosestPoint() = 0;
86  };
87  }
88  }
89 }
90 #endif
virtual ~RayQuery()
Destructor.
Definition: RayQuery.hh:58
A Ray Query class used for computing ray object intersections.
Definition: RayQuery.hh:54
A class that stores ray query intersection results.
Definition: RayQuery.hh:34
math::Vector3d point
Intersection point in 3d space.
Definition: RayQuery.hh:40
Represents an object present in the scene graph. This includes sub-meshes, materials, render targets, as well as posable nodes.
Definition: Object.hh:34