Gazebo Rendering

API Reference

7.4.2

A Ray Query class used for computing ray object intersections. More...

#include <BaseRayQuery.hh>

Public Member Functions

virtual ~BaseRayQuery () override
 Destructor. More...
 
virtual RayQueryResult ClosestPoint (bool _forceSceneUpdate=true) override
 Compute intersections. More...
 
virtual math::Vector3d Direction () const override
 Get ray direction. More...
 
virtual math::Vector3d Origin () const override
 Get ray origin. More...
 
virtual void SetDirection (const math::Vector3d &_dir) override
 Set ray direction. More...
 
virtual void SetFromCamera (const CameraPtr &_camera, const math::Vector2d &_coord) override
 Create the ray query from camera. More...
 
virtual void SetOrigin (const math::Vector3d &_origin) override
 Set ray origin. More...
 
- Public Member Functions inherited from RayQuery
virtual ~RayQuery ()
 Destructor. More...
 
- Public Member Functions inherited from Object
virtual ~Object ()
 Destructor. More...
 
virtual void Destroy ()=0
 Destroy any resources associated with this object. Invoking any other functions after destroying an object will result in undefined behavior. More...
 
virtual unsigned int Id () const =0
 Get the object ID. This ID will be unique across all objects inside a given scene, but necessarily true for objects across different scenes. More...
 
virtual std::string Name () const =0
 Get the object name. This name will be unique across all objects inside a given scene, but necessarily true for objects across different scenes. More...
 
virtual void PostRender ()=0
 Post process this object and any of its children after rendering. More...
 
virtual void PreRender ()=0
 Prepare this object and any of its children for rendering. This should be called for each object in a scene just before rendering, which can be achieved by a single call to Scene::PreRender. More...
 
virtual ScenePtr Scene () const =0
 Get the Scene that created this object. More...
 

Protected Member Functions

 BaseRayQuery ()
 Constructor. More...
 

Protected Attributes

math::Vector3d direction
 Ray direction. More...
 
math::Vector3d origin
 Ray origin. More...
 

Detailed Description

template<class T>
class gz::rendering::BaseRayQuery< T >

A Ray Query class used for computing ray object intersections.

gz/rendering/base/BaseRayQuery.hh

Constructor & Destructor Documentation

◆ BaseRayQuery()

BaseRayQuery
protected

Constructor.

◆ ~BaseRayQuery()

~BaseRayQuery
overridevirtual

Destructor.

Member Function Documentation

◆ ClosestPoint()

RayQueryResult ClosestPoint ( bool  _forceSceneUpdate = true)
overridevirtual

Compute intersections.

Parameters
[in]_forceSceneUpdatePerformance optimization hint When true Ogre2 will update all derived transforms to their latest to get correct results.

When false, that step is skipped. It is only safe to set it to false when nothing has changed since the last update (i.e. nothing moved, no new objects created).

Ogre will assert if built in Debug mode if this value is set to false when it shouldn't be.

See https://ogrecave.github.io/ogre-next/api/2.2/ _ogre20_changes.html::AssersionCachedOutOfDate for more info

Returns
A vector of intersection results

Implements RayQuery.

Reimplemented in OgreRayQuery, and Ogre2RayQuery.

◆ Direction()

gz::math::Vector3d Direction ( ) const
overridevirtual

Get ray direction.

Returns
Ray direction.

Implements RayQuery.

◆ Origin()

gz::math::Vector3d Origin ( ) const
overridevirtual

Get ray origin.

Returns
Ray origin

Implements RayQuery.

◆ SetDirection()

void SetDirection ( const math::Vector3d _dir)
overridevirtual

Set ray direction.

Parameters
[in]_dirRay origin

Implements RayQuery.

◆ SetFromCamera()

void SetFromCamera ( const CameraPtr _camera,
const math::Vector2d _coord 
)
overridevirtual

Create the ray query from camera.

Parameters
[in]_cameraCamera to construct ray
[in]_coordnormalized device coords [-1, +1]

Implements RayQuery.

Reimplemented in OgreRayQuery, and Ogre2RayQuery.

◆ SetOrigin()

void SetOrigin ( const math::Vector3d _origin)
overridevirtual

Set ray origin.

Parameters
[in]_originRay origin

Implements RayQuery.

Member Data Documentation

◆ direction

math::Vector3d direction
protected

Ray direction.

◆ origin

math::Vector3d origin
protected

Ray origin.


The documentation for this class was generated from the following file: