Commit 029641f1 authored by Martin Schultz's avatar Martin Schultz

Added functions to retrieve viewing rays for raycasting from examiner widgets

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@20557 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 174373cb
......@@ -458,6 +458,20 @@ ACG::SceneGraph::DrawModes::DrawMode drawMode( int _viewer ) {
return viewerProperties(activeExaminer()).drawMode();
}
//get a viewing ray for the active examiner x and y are in widgetspace
void getViewingRay(int _x, int _y,
ACG::Vec3d& _outOrigin, ACG::Vec3d& _outDirection)
{
getViewingRay(_x,_y,_outOrigin,_outDirection,activeExaminer_);
}
//get a viewing ray for the specified examiner x and y are in widgetspace
void getViewingRay(int _x, int _y,
ACG::Vec3d& _outOrigin, ACG::Vec3d& _outDirection, int _viewerIndex)
{
viewerProperties(_viewerIndex).glState().viewing_ray(_x,_y,_outOrigin,_outDirection);
}
// Pick returning node index
bool scenegraphPick( ACG::SceneGraph::PickTarget _pickTarget, const QPoint &_mousePos, unsigned int &_nodeIdx, unsigned int &_targetIdx, ACG::Vec3d *_hitPointPtr=0 ) {
......
......@@ -237,6 +237,33 @@ void setEncodedExaminerView(int _viewerId , QString _view );
DLLEXPORT
void setSceneCenter(const ACG::Vec3d& _center, int _viewer );
/** \brief Retrieve a viewing ray from the active examiner that can be used for raycasting.
*
* @param _x The widgetspace x Coordinate
* @param _y The widgetspace y Coordinate
* @param _outOrigin A reference to the ACG::Vec3d that shall hold the origin
* of the viewing Ray in worldspace coordinates.
* @param _outDirection A reference to the ACG::Vec3d that shall hold the direction
* of the viewing Ray in worldspace (normalized)
**/
DLLEXPORT
void getViewingRay(int _x, int _y,
ACG::Vec3d& _outOrigin, ACG::Vec3d& _outDirection);
/** \brief Retrieve a viewing ray from the specified examiner that can be used for raycasting.
*
* @param _x The widgetspace x Coordinate
* @param _y The widgetspace y Coordinate
* @param _outOrigin A reference to the ACG::Vec3d that shall hold the origin
* of the viewing Ray in worldspace coordinates.
* @param _outDirection A reference to the ACG::Vec3d that shall hold the direction
* of the viewing Ray in worldspace (normalized)
* @param _viewerIndex The index to specify an examiner that shall be used
**/
DLLEXPORT
void getViewingRay(int _x, int _y,
ACG::Vec3d& _outOrigin, ACG::Vec3d& _outDirection, int _viewerIndex);
/** \brief Execute picking operation on scenegraph
*
* This picking function will pick in the last active examiner context which is automatically
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment