SLProject  4.2.000
A platform independent 3D computer graphics framework for desktop OS, Android, iOS and online in web browsers
SLEventHandler Class Reference

Virtual Eventhandler class. More...

#include <SLEventHandler.h>

Inheritance diagram for SLEventHandler:
[legend]

Public Member Functions

 SLEventHandler ()
 
virtual ~SLEventHandler ()
 
virtual SLbool onMouseDown (const SLMouseButton button, const SLint x, const SLint y, const SLKey mod)
 
virtual SLbool onMouseUp (const SLMouseButton button, const SLint x, const SLint y, const SLKey mod)
 
virtual SLbool onMouseMove (const SLMouseButton button, const SLint x, const SLint y, const SLKey mod)
 
virtual SLbool onDoubleClick (const SLMouseButton button, const SLint x, const SLint y, const SLKey mod)
 
virtual SLbool onMouseWheel (const SLint delta, const SLKey mod)
 
virtual SLbool onTouch2Down (const SLint x1, const SLint y1, const SLint x2, const SLint y2)
 
virtual SLbool onTouch2Move (const SLint x1, const SLint y1, const SLint x2, const SLint y2)
 
virtual SLbool onTouch2Up (const SLint x1, const SLint y1, const SLint x2, const SLint y2)
 
virtual SLbool onTouch3Down (const SLint x1, const SLint y1)
 
virtual SLbool onTouch3Move (const SLint x1, const SLint y1)
 
virtual SLbool onTouch3Up (const SLint x1, const SLint y1)
 
virtual SLbool onKeyPress (const SLKey key, const SLKey mod)
 
virtual SLbool onKeyRelease (const SLKey key, const SLKey mod)
 
virtual SLbool onRotationPYR (const SLfloat pitchRAD, const SLfloat yawRAD, const SLfloat rollRAD)
 
void mouseRotationFactor (SLfloat rf)
 
SLfloat mouseRotationFactor ()
 

Protected Attributes

SLfloat _mouseRotationFactor
 Mouse rotation sensibility. More...
 
SLfloat _keyboardDeltaPos
 Delta dist. for keyboard translation. More...
 

Detailed Description

Virtual Eventhandler class.

SLEventHandler provides virtual methods for basic mouse and keyboard events. The SLNode class is derived from the SLEventhandler class and therefore all nodes can act as a eventhandler. For the moment only the camera class handles the events and implements this way the trackball camera. The scene instance has a pointer to the active eventhandler and forwards the events that it gets from the user interface. See also: SLSceneView and SLCamera classes.

Definition at line 27 of file SLEventHandler.h.

Constructor & Destructor Documentation

◆ SLEventHandler()

SLEventHandler::SLEventHandler ( )
inline

Definition at line 30 of file SLEventHandler.h.

31  {
32  // todo anim
33  _mouseRotationFactor = 0.1f;
34  _keyboardDeltaPos = 0.1f;
35  //_dRot = 15.0f;
36  }
SLfloat _keyboardDeltaPos
Delta dist. for keyboard translation.
SLfloat _mouseRotationFactor
Mouse rotation sensibility.

◆ ~SLEventHandler()

virtual SLEventHandler::~SLEventHandler ( )
inlinevirtual

Definition at line 37 of file SLEventHandler.h.

37 { ; }

Member Function Documentation

◆ mouseRotationFactor() [1/2]

SLfloat SLEventHandler::mouseRotationFactor ( )
inline

Definition at line 149 of file SLEventHandler.h.

149 { return _mouseRotationFactor; }

◆ mouseRotationFactor() [2/2]

void SLEventHandler::mouseRotationFactor ( SLfloat  rf)
inline

Definition at line 146 of file SLEventHandler.h.

146 { _mouseRotationFactor = rf; }

◆ onDoubleClick()

virtual SLbool SLEventHandler::onDoubleClick ( const SLMouseButton  button,
const SLint  x,
const SLint  y,
const SLKey  mod 
)
inlinevirtual

Definition at line 72 of file SLEventHandler.h.

76  {
77  (void)button;
78  (void)x;
79  (void)y;
80  return false;
81  }
typedef void(SL_STDCALL *cbOnImGuiBuild)(SLScene *s
Callback function typedef for ImGui build function.

◆ onKeyPress()

virtual SLbool SLEventHandler::onKeyPress ( const SLKey  key,
const SLKey  mod 
)
inlinevirtual

Reimplemented in SLCamera, and SLGLUniform< T >.

Definition at line 124 of file SLEventHandler.h.

126  {
127  (void)key;
128  (void)mod;
129  return false;
130  }
T mod(T a, T b)
Definition: Utils.h:250

◆ onKeyRelease()

virtual SLbool SLEventHandler::onKeyRelease ( const SLKey  key,
const SLKey  mod 
)
inlinevirtual

Reimplemented in SLCamera.

Definition at line 131 of file SLEventHandler.h.

133  {
134  (void)key;
135  (void)mod;
136  return false;
137  }

◆ onMouseDown()

virtual SLbool SLEventHandler::onMouseDown ( const SLMouseButton  button,
const SLint  x,
const SLint  y,
const SLKey  mod 
)
inlinevirtual

Reimplemented in SLTransformNode, and SLCamera.

Definition at line 40 of file SLEventHandler.h.

44  {
45  (void)button;
46  (void)x;
47  (void)y;
48  return false;
49  }

◆ onMouseMove()

virtual SLbool SLEventHandler::onMouseMove ( const SLMouseButton  button,
const SLint  x,
const SLint  y,
const SLKey  mod 
)
inlinevirtual

Reimplemented in SLTransformNode, and SLCamera.

Definition at line 61 of file SLEventHandler.h.

65  {
66  (void)button;
67  (void)x;
68  (void)y;
69  (void)mod;
70  return false;
71  }

◆ onMouseUp()

virtual SLbool SLEventHandler::onMouseUp ( const SLMouseButton  button,
const SLint  x,
const SLint  y,
const SLKey  mod 
)
inlinevirtual

Reimplemented in SLTransformNode, and SLCamera.

Definition at line 50 of file SLEventHandler.h.

54  {
55  (void)button;
56  (void)x;
57  (void)y;
58  (void)mod;
59  return false;
60  }

◆ onMouseWheel()

virtual SLbool SLEventHandler::onMouseWheel ( const SLint  delta,
const SLKey  mod 
)
inlinevirtual

Reimplemented in SLCamera.

Definition at line 82 of file SLEventHandler.h.

83  {
84  (void)delta;
85  (void)mod;
86  return false;
87  }

◆ onRotationPYR()

virtual SLbool SLEventHandler::onRotationPYR ( const SLfloat  pitchRAD,
const SLfloat  yawRAD,
const SLfloat  rollRAD 
)
inlinevirtual

Definition at line 138 of file SLEventHandler.h.

141  {
142  return false;
143  }

◆ onTouch2Down()

virtual SLbool SLEventHandler::onTouch2Down ( const SLint  x1,
const SLint  y1,
const SLint  x2,
const SLint  y2 
)
inlinevirtual

Reimplemented in SLCamera.

Definition at line 88 of file SLEventHandler.h.

92  {
93  return false;
94  }

◆ onTouch2Move()

virtual SLbool SLEventHandler::onTouch2Move ( const SLint  x1,
const SLint  y1,
const SLint  x2,
const SLint  y2 
)
inlinevirtual

Reimplemented in SLCamera.

Definition at line 95 of file SLEventHandler.h.

99  {
100  return false;
101  }

◆ onTouch2Up()

virtual SLbool SLEventHandler::onTouch2Up ( const SLint  x1,
const SLint  y1,
const SLint  x2,
const SLint  y2 
)
inlinevirtual

Reimplemented in SLCamera.

Definition at line 102 of file SLEventHandler.h.

106  {
107  return false;
108  }

◆ onTouch3Down()

virtual SLbool SLEventHandler::onTouch3Down ( const SLint  x1,
const SLint  y1 
)
inlinevirtual

Definition at line 109 of file SLEventHandler.h.

111  {
112  return false;
113  }

◆ onTouch3Move()

virtual SLbool SLEventHandler::onTouch3Move ( const SLint  x1,
const SLint  y1 
)
inlinevirtual

Definition at line 114 of file SLEventHandler.h.

116  {
117  return false;
118  }

◆ onTouch3Up()

virtual SLbool SLEventHandler::onTouch3Up ( const SLint  x1,
const SLint  y1 
)
inlinevirtual

Definition at line 119 of file SLEventHandler.h.

121  {
122  return false;
123  }

Member Data Documentation

◆ _keyboardDeltaPos

SLfloat SLEventHandler::_keyboardDeltaPos
protected

Delta dist. for keyboard translation.

Definition at line 153 of file SLEventHandler.h.

◆ _mouseRotationFactor

SLfloat SLEventHandler::_mouseRotationFactor
protected

Mouse rotation sensibility.

Definition at line 152 of file SLEventHandler.h.


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