OpenFrames
Public Member Functions | Protected Attributes | List of all members
OpenFrames::OpenVRDevice::LaserModel Class Reference

Encapsulates the laser attached to OpenVR devices (usually controllers). More...

#include <OpenVRDevice.hpp>

Inheritance diagram for OpenFrames::OpenVRDevice::LaserModel:

Public Member Functions

osg::MatrixTransform * getTransform () const
 Get Local->World matrix (transforms points in Laser frame to Controller frame)
 
void showLaser (bool show)
 
bool isLaserShown () const
 
void setLaserHideDelay (const double &delay)
 
double getLaserHideDelay () const
 
void setColor (const osg::Vec4 &color)
 Laser color.
 
const osg::Vec4 & getColor () const
 
void setDefaultColor (const osg::Vec4 &color)
 
const osg::Vec4 & getDefaultColor () const
 
void setLength (const double &length)
 Laser length (meters)
 
double getLength () const
 
void setDefaultLength (const double &length)
 
double getDefaultLength () const
 
void setWidth (const float &width)
 Laser width (pixels)
 
float getWidth () const
 
void setDefaultWidth (const float &width)
 
float getDefaultWidth () const
 
const osg::Timer_t & getUpdateTime () const
 Last time any laser property was updated.
 
void restoreDefaults ()
 

Protected Attributes

osg::ref_ptr< osg::MatrixTransform > _laserTransform
 
osg::Timer_t _lastUpdateTime
 
osg::ref_ptr< osg::Geometry > _geom
 
osg::ref_ptr< osg::Vec3Array > _vertices
 
osg::ref_ptr< osg::Vec4Array > _colors
 
osg::ref_ptr< osg::LineWidth > _lineWidth
 
double _hideDelay
 
double _defaultLength
 
osg::Vec4 _defaultColor
 
float _defaultWidth
 

Detailed Description

Encapsulates the laser attached to OpenVR devices (usually controllers).

Member Function Documentation

◆ setLaserHideDelay()

void OpenFrames::OpenVRDevice::LaserModel::setLaserHideDelay ( const double &  delay)
inline

Set a delay for hiding the laser, in seconds If delay > 0 then any request to hide the laser will be applied only after its parameters have not changed for the specified amount of time. Laser hides immediately if delay <= 0 Laser stays on indefinitely if delay = DBL_MAX

◆ showLaser()

void OpenFrames::OpenVRDevice::LaserModel::showLaser ( bool  show)

Show/hide the laser Note that delay-hiding the laser can be overridden by showing the laser


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