SO3Engine
include
SO3SceneGraph
SO3VirtualPointer.h
Go to the documentation of this file.
1
/*
2
-----------------------------------------------------------------------------
3
This source file is part of OpenSpace3D
4
For the latest info, see http://www.openspace3d.com
5
6
Copyright (c) 2012 I-maginer
7
8
This program is free software; you can redistribute it and/or modify it under
9
the terms of the GNU Lesser General Public License as published by the Free Software
10
Foundation; either version 2 of the License, or (at your option) any later
11
version.
12
13
This program is distributed in the hope that it will be useful, but WITHOUT
14
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15
FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
16
17
You should have received a copy of the GNU Lesser General Public License along with
18
this program; if not, write to the Free Software Foundation, Inc., 59 Temple
19
Place - Suite 330, Boston, MA 02111-1307, USA, or go to
20
http://www.gnu.org/copyleft/lesser.txt
21
22
-----------------------------------------------------------------------------
23
*/
24
32
#ifndef __SO3VIRTUAL_POINTER_H__
33
#define __SO3VIRTUAL_POINTER_H__
34
35
#include "
SCOLBasic/SO3Prerequisites.h
"
36
#include "
SO3SceneGraph/SO3NodeScol.h
"
37
#include "
SO3SceneGraph/SO3SubEntityCameraSelectorBuffer.h
"
38
#include "
SO3Renderer/SO3Window.h
"
39
#include "
SO3Renderer/SO3ViewPort.h
"
40
#include "
SO3Utils/SO3RayCast.h
"
41
42
namespace
SO3
43
{
44
45
class
_SO3_Export
SVirtualPointer
:
public
SNode
46
{
47
public
:
48
protected
:
49
private
:
50
Ogre::Camera* mRayCam;
51
bool
mState;
52
bool
mAutoUpdate;
53
unsigned
int
mRenderSize;
54
float
mMaxlength;
55
SWindow::SelectorMode
mSelectorMode;
56
SSubEntityCameraSelectorBuffer
* mCameraSelector;
57
SRaycastResult
mRaycastValue;
58
int
mId;
59
60
public
:
63
SVirtualPointer
(
SScene
* parent,
const
std::string& dynamicCubeMapName,
const
float
maxlength = 1000.0f);
64
67
~SVirtualPointer
();
68
71
void
SetEnable(
const
bool
& newState);
72
75
bool
GetEnable();
76
79
void
SetSelectorMode(
SWindow::SelectorMode
mode);
80
83
void
SetMaxLength(
const
float
& length);
84
87
float
GetMaxLength();
88
91
int
GetID();
92
96
void
Update();
97
98
void
Click(
const
MouseButtonId
& btn);
99
100
void
UnClick(
const
MouseButtonId
& btn);
101
102
void
MoveCursor(
const
MouseButtonId
& btn);
103
104
void
Wheel(
const
int
delta);
105
106
bool
HasWidgetUnder();
107
108
float
GetLength();
109
110
Ogre::Vector3 GetTargetPosition();
111
112
SEntity
* GetSelectedObject();
113
114
SMaterial
* GetSelectedMaterial();
115
116
int
GetSelectedSubEntity();
117
118
const
SRaycastResult
& GetRaycastResult();
119
protected
:
120
private
:
124
SVirtualPointer
();
125
126
void
CheckRayCastValidity();
127
};
128
129
}
130
131
#endif
SO3NodeScol.h
SO3Prerequisites.h
librairies include
SO3RayCast.h
SO3SubEntityCameraSelectorBuffer.h
SO3ViewPort.h
SO3Window.h
SO3::SEntity
Definition
SO3Entity.h:43
SO3::SMaterial
Definition
SO3Material.h:43
SO3::SNode
Definition
SO3NodeScol.h:43
SO3::SRaycastResult
Definition
SO3RayCast.h:41
SO3::SScene
Definition
SO3Scene.h:125
SO3::SSubEntityCameraSelectorBuffer
Definition
SO3SubEntityCameraSelectorBuffer.h:48
SO3::SVirtualPointer
Definition
SO3VirtualPointer.h:46
SO3::SWindow::SelectorMode
SelectorMode
Definition
SO3Window.h:48
SO3
Definition
SO3DataScol.h:38
SO3::MouseButtonId
MouseButtonId
Definition
SO3Prerequisites.h:285
Generated by
1.9.8