Image Component Library (ICL)
Public Member Functions | Private Member Functions | Private Attributes | List of all members
icl::physics::PhysicsMouseHandler Class Reference

This mousehandler can pick up object and move them around. More...

#include <PhysicsMouseHandler.h>

Inheritance diagram for icl::physics::PhysicsMouseHandler:
icl::geom::SceneMouseHandler icl::qt::MouseHandler

Public Member Functions

 PhysicsMouseHandler (const int pCameraIndex, geom::Scene *pParentScene, PhysicsWorld *pPhysicsWorld)
 Constructor that creates the Camera for the given scene and physicsworld at the given index. More...
 
 PhysicsMouseHandler (const int pCameraIndex, PhysicsScene *pPhysicsScene)
 Constructor that creates the Camera for the given PhysicsScene at the given index. More...
 
virtual void process (const qt::MouseEvent &pMouseEvent)
 Process mouse event using mouse mapping table. More...
 
virtual ~PhysicsMouseHandler ()
 
- Public Member Functions inherited from icl::geom::SceneMouseHandler
ICLGeom_API SceneMouseHandler (const int pCameraIndex, Scene *pParentScene)
 Constructor. More...
 
 SceneMouseHandler (const SceneMouseHandler &pSceneMouseHandler)
 Copy constructor. More...
 
ICLGeom_API ~SceneMouseHandler ()
 Destructor. More...
 
ICLGeom_API SceneMouseHandleroperator= (const SceneMouseHandler &pSceneMouseHandler)
 Assignment operator. More...
 
void setParentScene (Scene *pParentScene)
 Set parent scene. More...
 
ScenegetParentScene ()
 Get parent scene. More...
 
ICLGeom_API void setSensitivities (const float pTranslation, const float pRotation=1.0, const float pMouse=1.0, const float pWheel=0.001, const float pModifier=10.0)
 Set mouse & wheel sensitivities, modifier factor and factors for rotation and translation. More...
 
MouseSensitivities getSensitivities (MouseSensitivitiesModifier pMouseSensitivitiesModifier)
 Get mouse and wheel sensitivities (low, normal, high). More...
 
void setCameraIndex (const int pCameraIndex)
 Set camera index. More...
 
int getCameraIndex ()
 Get camera index. More...
 
virtual ICLGeom_API void setMouseMappings ()
 Set mouse mappings. More...
 
ICLGeom_API void setMouseMapping (const qt::MouseEventType pMouseEventType, const bool pLeftMouseButton, const bool pMiddleMouseButton, const bool pRightMouseButton, const bool pShift, const bool pControl, const bool pAlt, MouseActionCallback pMouseActionCallback, void *pData=0)
 Set one mouse mapping. More...
 
- Public Member Functions inherited from icl::qt::MouseHandler
 MouseHandler (mouse_handler handler)
 Create a mouse handler with given callback function. More...
 

Private Member Functions

void removeConstraint ()
 

Private Attributes

geom::Scenem_parentScene
 
PhysicsWorldm_physicsWorld
 
RigidObjectm_selectedObject
 
geom::Vec hitpoint
 
geom::Vec relPos
 
geom::Vec pointer3d
 
Object2PointConstraintm_constraint
 
int m_camIndex
 

Additional Inherited Members

- Public Types inherited from icl::qt::MouseHandler
typedef void(* mouse_handler) (const MouseEvent &event)
 mouse_handler function type More...
 
- Public Slots inherited from icl::qt::MouseHandler
void handleEvent (const MouseEvent &event)
 connected to the ICLWidget's signal mouseEventOccured More...
 
- Static Public Member Functions inherited from icl::geom::SceneMouseHandler
static ICLGeom_API void freeView (const qt::MouseEvent &pMouseEvent, const utils::Point32f &pCurrentMousePosition, const utils::Point32f &pDeltaMousePosition, Camera &pCamera, Scene &pScene, void *pData, bool pInverseX, bool pInverseY)
 Free view. More...
 
static void freeView (const qt::MouseEvent &pMouseEvent, const utils::Point32f &pCurrentMousePosition, const utils::Point32f &pDeltaMousePosition, Camera &pCamera, Scene &pScene, void *pData)
 Free view with normal axes. More...
 
static void freeViewInverseMouseX (const qt::MouseEvent &pMouseEvent, const utils::Point32f &pCurrentMousePosition, const utils::Point32f &pDeltaMousePosition, Camera &pCamera, Scene &pScene, void *pData)
 Free view with inversed x-axis. More...
 
static void freeViewInverseMouseY (const qt::MouseEvent &pMouseEvent, const utils::Point32f &pCurrentMousePosition, const utils::Point32f &pDeltaMousePosition, Camera &pCamera, Scene &pScene, void *pData)
 Free view with inversed y-axis. More...
 
static void freeViewInverseBoth (const qt::MouseEvent &pMouseEvent, const utils::Point32f &pCurrentMousePosition, const utils::Point32f &pDeltaMousePosition, Camera &pCamera, Scene &pScene, void *pData)
 Free view with inversed axes. More...
 
static ICLGeom_API void rotateAroundOrigin (const qt::MouseEvent &pMouseEvent, const utils::Point32f &pCurrentMousePosition, const utils::Point32f &pDeltaMousePosition, Camera &pCamera, Scene &pScene, void *pData)
 Rotate around origin and correct camera orientation. More...
 
static ICLGeom_API void strafe (const qt::MouseEvent &pMouseEvent, const utils::Point32f &pCurrentMousePosition, const utils::Point32f &pDeltaMousePosition, Camera &pCamera, Scene &pScene, void *pData)
 Strafe (camera movement up, down, left, right). More...
 
static ICLGeom_API void rollAndDistance (const qt::MouseEvent &pMouseEvent, const utils::Point32f &pCurrentMousePosition, const utils::Point32f &pDeltaMousePosition, Camera &pCamera, Scene &pScene, void *pData)
 Roll and distance (camera movement forward and backward). More...
 
static ICLGeom_API void placeCursor (const qt::MouseEvent &pMouseEvent, const utils::Point32f &pCurrentMousePosition, const utils::Point32f &pDeltaMousePosition, Camera &pCamera, Scene &pScene, void *pData)
 Place the cursor for rotational Origin. More...
 
- Protected Member Functions inherited from icl::qt::MouseHandler
 MouseHandler ()
 This constructor can be called from derived classes. More...
 
- Protected Attributes inherited from icl::geom::SceneMouseHandler
MouseMappingTableEntry mMouseMappingTable [qt::MAX_MOUSE_EVENT+1][2][2][2][2][2][2]
 Mouse mapping table: More...
 
MouseSensitivities mMouseSensitivities [MAX_MOUSE_SENSITIVITY+1]
 mouse sensitivities More...
 
Camera mCameraBackup
 backup of old camera More...
 
utils::Point32f mAnchor
 starting mouse position for dragging More...
 
ScenemParentScene
 pointer to parent scene More...
 
int mCameraIndex
 index of camera in scene More...
 
int mKeyboardModifiersBackup
 backup of old keyboard modifiers More...
 
qt::GUImGUI
 GUI for the adaption of scene properties. More...
 

Detailed Description

This mousehandler can pick up object and move them around.

Constructor & Destructor Documentation

◆ PhysicsMouseHandler() [1/2]

icl::physics::PhysicsMouseHandler::PhysicsMouseHandler ( const int  pCameraIndex,
geom::Scene pParentScene,
PhysicsWorld pPhysicsWorld 
)

Constructor that creates the Camera for the given scene and physicsworld at the given index.

◆ PhysicsMouseHandler() [2/2]

icl::physics::PhysicsMouseHandler::PhysicsMouseHandler ( const int  pCameraIndex,
PhysicsScene pPhysicsScene 
)

Constructor that creates the Camera for the given PhysicsScene at the given index.

◆ ~PhysicsMouseHandler()

virtual icl::physics::PhysicsMouseHandler::~PhysicsMouseHandler ( )
virtual

Member Function Documentation

◆ process()

virtual void icl::physics::PhysicsMouseHandler::process ( const qt::MouseEvent pMouseEvent)
virtual

Process mouse event using mouse mapping table.

Parameters
pMouseEventmouse event

Reimplemented from icl::geom::SceneMouseHandler.

◆ removeConstraint()

void icl::physics::PhysicsMouseHandler::removeConstraint ( )
private

Member Data Documentation

◆ hitpoint

geom::Vec icl::physics::PhysicsMouseHandler::hitpoint
private

◆ m_camIndex

int icl::physics::PhysicsMouseHandler::m_camIndex
private

◆ m_constraint

Object2PointConstraint* icl::physics::PhysicsMouseHandler::m_constraint
private

◆ m_parentScene

geom::Scene* icl::physics::PhysicsMouseHandler::m_parentScene
private

◆ m_physicsWorld

PhysicsWorld* icl::physics::PhysicsMouseHandler::m_physicsWorld
private

◆ m_selectedObject

RigidObject* icl::physics::PhysicsMouseHandler::m_selectedObject
private

◆ pointer3d

geom::Vec icl::physics::PhysicsMouseHandler::pointer3d
private

◆ relPos

geom::Vec icl::physics::PhysicsMouseHandler::relPos
private

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