Ignition Rendering

API Reference

5.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 
21 #include <ignition/math/Vector3.hh>
22 
23 #include "ignition/rendering/config.hh"
27 
28 namespace ignition
29 {
30  namespace rendering
31  {
32  inline namespace IGNITION_RENDERING_VERSION_NAMESPACE {
33  //
35  class IGNITION_RENDERING_VISIBLE RayQueryResult
36  {
38  public: double distance = -1;
39 
44 
46  public: unsigned int objectId = 0;
47 
49  public: operator bool() const
50  {
51  return distance > 0;
52  }
53 
55  public: operator bool()
56  {
57  return distance > 0;
58  }
59  };
60 
63  class IGNITION_RENDERING_VISIBLE RayQuery
64  : public virtual Object
65  {
67  public: virtual ~RayQuery() { }
68 
71  public: virtual void SetOrigin(const math::Vector3d &_origin) = 0;
72 
75  public: virtual math::Vector3d Origin() const = 0;
76 
79  public: virtual void SetDirection(const math::Vector3d &_dir) = 0;
80 
83  public: virtual math::Vector3d Direction() const = 0;
84 
88  public: virtual void SetFromCamera(const CameraPtr &_camera,
89  const math::Vector2d &_coord) = 0;
90 
93  public: virtual RayQueryResult ClosestPoint() = 0;
94  };
95  }
96  }
97 }
98 #endif
#define IGN_COMMON_WARN_RESUME__DLL_INTERFACE_MISSING
virtual ~RayQuery()
Destructor.
Definition: RayQuery.hh:67
A Ray Query class used for computing ray object intersections.
Definition: RayQuery.hh:63
A class that stores ray query intersection results.
Definition: RayQuery.hh:35
math::Vector3d point
Intersection point in 3d space.
Definition: RayQuery.hh:42
Represents an object present in the scene graph. This includes sub-meshes, materials, render targets, as well as posable nodes.
Definition: Object.hh:34
#define IGN_COMMON_WARN_IGNORE__DLL_INTERFACE_MISSING