Ignition Rendering

API Reference

0.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 
25 
26 namespace ignition
27 {
28  namespace rendering
29  {
31  class IGNITION_RENDERING_VISIBLE RayQueryResult
32  {
34  public: double distance = -1;
35 
37  public: math::Vector3d point;
38 
40  public: unsigned int objectId = 0;
41 
43  public: operator bool()
44  {
45  return distance > 0;
46  }
47  };
48 
51  class IGNITION_RENDERING_VISIBLE RayQuery
52  : public virtual Object
53  {
55  public: virtual ~RayQuery() { }
56 
59  public: virtual void SetOrigin(const math::Vector3d &_origin) = 0;
60 
63  public: virtual math::Vector3d Origin() const = 0;
64 
67  public: virtual void SetDirection(const math::Vector3d &_dir) = 0;
68 
71  public: virtual math::Vector3d Direction() const = 0;
72 
76  public: virtual void SetFromCamera(const CameraPtr &_camera,
77  const math::Vector2d &_coord) = 0;
78 
82  public: virtual RayQueryResult ClosestPoint() = 0;
83  };
84  }
85 }
86 #endif
virtual ~RayQuery()
Destructor.
Definition: RayQuery.hh:55
A Ray Query class used for computing ray object intersections.
Definition: RayQuery.hh:51
A class that stores ray query intersection results.
Definition: RayQuery.hh:31
math::Vector3d point
Intersection point in 3d space.
Definition: RayQuery.hh:37
Definition: ArrowVisual.hh:22
Represents an object present in the scene graph. This includes sub-meshes, materials, render targets, as well as posable nodes.
Definition: Object.hh:31