Gazebo Rendering

API Reference

8.2.0
OgreRayQuery.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 GZ_RENDERING_OGRE_OGRERAYQUERY_HH_
18 #define GZ_RENDERING_OGRE_OGRERAYQUERY_HH_
19 
20 #include <memory>
21 
26 
27 namespace gz
28 {
29  namespace rendering
30  {
31  inline namespace GZ_RENDERING_VERSION_NAMESPACE {
32  //
33  // forward declaration
34  class OgreRayQueryPrivate;
35 
39  class GZ_RENDERING_OGRE_VISIBLE OgreRayQuery :
40  public BaseRayQuery<OgreObject>
41  {
43  protected: OgreRayQuery();
44 
46  public: virtual ~OgreRayQuery() override;
47 
48  // Documentation inherited
49  public: virtual void SetFromCamera(const CameraPtr &_camera,
50  const math::Vector2d &_coord) override;
51 
52  // Documentation inherited
53  public: void SetFromCamera(const WideAngleCameraPtr &_camera,
54  uint32_t _faceIdx,
55  const math::Vector2d &_coord) override;
56 
57  // Documentation inherited
58  public: virtual RayQueryResult ClosestPoint(
59  bool _forceSceneUpdate = true) override;
60 
70  // Code found in Wiki: www.ogre3d.org/wiki/index.php/RetrieveVertexData
71  private: void MeshInformation(const Ogre::Mesh *_mesh,
72  size_t &_vertexCount,
73  Ogre::Vector3* &_vertices,
74  size_t &_indexCount,
75  uint64_t* &_indices,
76  const math::Vector3d &_position,
77  const math::Quaterniond &_orient,
78  const math::Vector3d &_scale);
79 
81  private: std::unique_ptr<OgreRayQueryPrivate> dataPtr;
82 
84  private: friend class OgreScene;
85  };
86  }
87  }
88 }
89 #endif