MCPcopy Create free account
hub / github.com/DanielChappuis/reactphysics3d / mouseButtonEvent

Method mouseButtonEvent

testbed/src/SceneDemo.cpp:660–673  ·  view source on GitHub ↗

Called when a mouse button event occurs

Source from the content-addressed store, hash-verified

658
659// Called when a mouse button event occurs
660bool SceneDemo::mouseButtonEvent(int button, bool down, int mods, double mousePosX, double mousePosY) {
661
662 // Left mouse click with CTRL key pressed on keyboard (moving a body)
663 if (down && (mods & GLFW_MOD_CONTROL)) {
664
665 moveBodyWithMouse(mousePosX, mousePosY);
666 return true;
667 }
668
669 mIsMovingBody = false;
670 mMovingBody = nullptr;
671
672 return Scene::mouseButtonEvent(button, down, mods, mousePosX, mousePosY);
673}
674
675// Called when a mouse motion event occurs
676bool SceneDemo::mouseMotionEvent(double xMouse, double yMouse, int leftButtonState, int rightButtonState, int middleButtonState, int altKeyState) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected