PixelLightAPI  .
Public Member Functions
PLEngine::MousePicking Class Reference

Class offering scene picking functionality by using the mouse. More...

#include <MousePicking.h>

Inheritance diagram for PLEngine::MousePicking:
Inheritance graph
[legend]

List of all members.

Public Member Functions

PL_API MousePicking (PLCore::Frontend &cFrontend, PLScene::SNCamera *pCamera=nullptr)
 Constructor.
virtual PL_API ~MousePicking ()
 Destructor.
PL_API PLCore::FrontendGetFrontend () const
 Returns the frontend instance used to determine the mouse position.
PL_API PLScene::SNCameraGetCamera () const
 Returns the camera to perform the picking with.
PL_API void SetCamera (PLScene::SNCamera *pCamera)
 Sets the camera to perform the picking with.
PL_API bool PerformMousePicking (PickingResult &cPickingResult, float fMaxDistance=-1.0f, PLRenderer::Cull::Enum nCull=PLRenderer::Cull::CCW)
 Performs picking by using the current camera and current mouse position within the widget.
PL_API bool PerformMousePicking (PickingResult &cPickingResult, const PLMath::Vector2i &vMousePos, float fMaxDistance=-1.0f, PLRenderer::Cull::Enum nCull=PLRenderer::Cull::CCW)
 Performs picking by using the current camera and the given mouse position.

Detailed Description

Class offering scene picking functionality by using the mouse.


Constructor & Destructor Documentation

PL_API PLEngine::MousePicking::MousePicking ( PLCore::Frontend cFrontend,
PLScene::SNCamera pCamera = nullptr 
)

Constructor.

Parameters:
[in]cFrontendFrontend instance used to determine the mouse position
[in]pCameraCamera to perform the picking with, if a null pointer no picking is possible
virtual PL_API PLEngine::MousePicking::~MousePicking ( ) [virtual]

Destructor.


Member Function Documentation

Returns the frontend instance used to determine the mouse position.

Returns:
The frontend instance used to determine the mouse position

Returns the camera to perform the picking with.

Returns:
The camera to perform the picking with, if a null pointer no picking is possible

Sets the camera to perform the picking with.

Parameters:
[in]pCameraThe camera to perform the picking with, if a null pointer no picking is possible
PL_API bool PLEngine::MousePicking::PerformMousePicking ( PickingResult cPickingResult,
float  fMaxDistance = -1.0f,
PLRenderer::Cull::Enum  nCull = PLRenderer::Cull::CCW 
)

Performs picking by using the current camera and current mouse position within the widget.

Parameters:
[out]cPickingResultReceives the picking result if all went fine
[in]fMaxDistanceMaximum picking distance, if negative there's no maximum picking distance (in the same scene container the camera is in)
[in]nCullCull mode (see "PLRenderer::Cull")
Returns:
'true' if anything has been picked, else 'false'
Note:
  • For performance reasons we recommend to always set a maximum picking distance
  • The function will only work if a widget and camera is set ('SetWidget()' and 'GetCamera()')
PL_API bool PLEngine::MousePicking::PerformMousePicking ( PickingResult cPickingResult,
const PLMath::Vector2i vMousePos,
float  fMaxDistance = -1.0f,
PLRenderer::Cull::Enum  nCull = PLRenderer::Cull::CCW 
)

Performs picking by using the current camera and the given mouse position.

Parameters:
[out]cPickingResultReceives the picking result if all went fine
[in]vMousePosPosition of the mouse inside the widget the picking takes place
[in]fMaxDistanceMaximum picking distance, if negative there's no maximum picking distance (in the same scene container the camera is in)
[in]nCullCull mode (see "PLRenderer::Cull")
Returns:
'true' if anything has been picked, else 'false'
Note:
  • For performance reasons we recommend to always set a maximum picking distance
  • The function will only work if a widget and camera is set ('SetWidget()' and 'GetCamera()')

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


PixelLight PixelLight 0.9.11-R1
Copyright (C) 2002-2012 by The PixelLight Team
Last modified Thu Feb 23 2012 14:09:30
The content of this PixelLight document is published under the
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported