RigsofRods
Soft-body Physics Simulation
SceneMouse.h
Go to the documentation of this file.
1 /*
2  This source file is part of Rigs of Rods
3  Copyright 2005-2012 Pierre-Michel Ricordel
4  Copyright 2007-2012 Thomas Fischer
5  Copyright 2013-2014 Petr Ohlidal
6 
7  For more information, see http://www.rigsofrods.org/
8 
9  Rigs of Rods is free software: you can redistribute it and/or modify
10  it under the terms of the GNU General Public License version 3, as
11  published by the Free Software Foundation.
12 
13  Rigs of Rods is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  GNU General Public License for more details.
17 
18  You should have received a copy of the GNU General Public License
19  along with Rigs of Rods. If not, see <http://www.gnu.org/licenses/>.
20 */
21 
26 
27 #pragma once
28 
29 #include "Application.h"
30 #include "SimData.h"
31 
32 #include <OIS.h>
33 #include <Ogre.h>
34 
35 namespace RoR {
36 
38 {
39 public:
40 
41  SceneMouse();
42 
43  bool handleMouseMoved();
44  bool handleMousePressed();
45  bool handleMouseReleased();
46 
47  void InitializeVisuals();
48  void UpdateSimulation();
49  void UpdateVisuals();
50  void DiscardVisuals();
51 
52 protected:
53 
54  Ogre::ManualObject* pickLine;
55  Ogre::SceneNode* pickLineNode;
57 
59  float mindist;
61  Ogre::Vector3 lastgrabpos;
63 
64  void releaseMousePick();
65  Ogre::Ray getMouseRay();
66  void reset();
67 };
68 
69 } // namespace RoR
RoR::SceneMouse::lastMouseX
int lastMouseX
Definition: SceneMouse.h:62
RoR::SceneMouse::handleMouseReleased
bool handleMouseReleased()
Definition: SceneMouse.cpp:307
RoR::SceneMouse::reset
void reset()
Definition: SceneMouse.cpp:101
RoR::SceneMouse::DiscardVisuals
void DiscardVisuals()
Definition: SceneMouse.cpp:75
RoR::SceneMouse
Definition: SceneMouse.h:37
RoR::NODENUM_INVALID
static const NodeNum_t NODENUM_INVALID
Definition: ForwardDeclarations.h:53
RoR::SceneMouse::UpdateSimulation
void UpdateSimulation()
Definition: SceneMouse.cpp:199
RoR::SceneMouse::handleMousePressed
bool handleMousePressed()
Definition: SceneMouse.cpp:229
RefCountingObjectPtr< Actor >
RoR::SceneMouse::lastMouseY
int lastMouseY
Definition: SceneMouse.h:62
RoR::SceneMouse::mouseGrabState
int mouseGrabState
Definition: SceneMouse.h:56
RoR::SceneMouse::InitializeVisuals
void InitializeVisuals()
Definition: SceneMouse.cpp:50
RoR::NodeNum_t
uint16_t NodeNum_t
Node position within Actor::ar_nodes; use RoR::NODENUM_INVALID as empty value.
Definition: ForwardDeclarations.h:52
RoR::SceneMouse::SceneMouse
SceneMouse()
Definition: SceneMouse.cpp:41
SimData.h
Core data structures for simulation; Everything affected by by either physics, network or user intera...
RoR::SceneMouse::UpdateVisuals
void UpdateVisuals()
Definition: SceneMouse.cpp:212
Application.h
Central state/object manager and communications hub.
RoR::SceneMouse::grab_truck
ActorPtr grab_truck
Definition: SceneMouse.h:60
RoR::SceneMouse::mindist
float mindist
Definition: SceneMouse.h:59
RoR::SceneMouse::getMouseRay
Ogre::Ray getMouseRay()
Definition: SceneMouse.cpp:319
RoR::SceneMouse::pickLine
Ogre::ManualObject * pickLine
Definition: SceneMouse.h:54
RoR::SceneMouse::lastgrabpos
Ogre::Vector3 lastgrabpos
Definition: SceneMouse.h:61
RoR::SceneMouse::pickLineNode
Ogre::SceneNode * pickLineNode
Definition: SceneMouse.h:55
RoR::SceneMouse::handleMouseMoved
bool handleMouseMoved()
Definition: SceneMouse.cpp:114
RoR::SceneMouse::releaseMousePick
void releaseMousePick()
Definition: SceneMouse.cpp:90
RoR::SceneMouse::minnode
NodeNum_t minnode
Definition: SceneMouse.h:58
RoR
Definition: AppContext.h:36