Gazebo Rendering

API Reference

3.7.2
gz/rendering/Utils.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2019 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 GZ_RENDERING_UTILS_HH_
18 #define GZ_RENDERING_UTILS_HH_
19 
20 #include <gz/math/Helpers.hh>
21 #include <gz/math/Vector2.hh>
22 #include <gz/math/Vector3.hh>
23 
24 #include "gz/rendering/Camera.hh"
25 #include "gz/rendering/config.hh"
26 #include "gz/rendering/Export.hh"
27 #include "gz/rendering/RayQuery.hh"
28 
29 
30 namespace ignition
31 {
33  namespace rendering
34  {
35  // Inline bracket to help doxygen filtering.
36  inline namespace IGNITION_RENDERING_VERSION_NAMESPACE {
37  //
45  IGNITION_RENDERING_VISIBLE
47  const math::Vector2i &_screenPos,
48  const CameraPtr &_camera,
49  const RayQueryPtr &_rayQuery,
50  float _maxDistance = 10.0);
51 
60  IGNITION_RENDERING_VISIBLE
62  const math::Vector2i &_screenPos,
63  const CameraPtr &_camera,
64  const RayQueryPtr &_rayQuery,
65  RayQueryResult &_rayResult,
66  float _maxDistance = 10.0);
67 
75  IGNITION_RENDERING_VISIBLE
77  const math::Vector2i &_screenPos,
78  const CameraPtr &_camera,
79  const RayQueryPtr &_rayQuery,
80  const float _offset = 0.0);
81 
84  IGNITION_RENDERING_VISIBLE
85  float screenScalingFactor();
86  }
87  }
88 }
89 #endif
shared_ptr< RayQuery > RayQueryPtr
Shared pointer to RayQuery.
Definition: gz/rendering/RenderTypes.hh:171
Vector2< int > Vector2i
math::Vector3d screenToScene(const math::Vector2i &_screenPos, const CameraPtr &_camera, const RayQueryPtr &_rayQuery, float _maxDistance=10.0)
Retrieve the first point on a surface in the 3D scene hit by a ray cast from the given 2D screen coor...
float screenScalingFactor()
Get the screen scaling factor.
shared_ptr< Camera > CameraPtr
Shared pointer to Camera.
Definition: gz/rendering/RenderTypes.hh:95
Vector3< double > Vector3d
math::Vector3d screenToPlane(const math::Vector2i &_screenPos, const CameraPtr &_camera, const RayQueryPtr &_rayQuery, const float _offset=0.0)
Retrieve the point on a plane at z = 0 in the 3D scene hit by a ray cast from the given 2D screen coo...