diff options
Diffstat (limited to 'SixenseSDK/include/sixense_utils/mouse_pointer.hpp')
| -rwxr-xr-x | SixenseSDK/include/sixense_utils/mouse_pointer.hpp | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/SixenseSDK/include/sixense_utils/mouse_pointer.hpp b/SixenseSDK/include/sixense_utils/mouse_pointer.hpp new file mode 100755 index 0000000..fb16e6a --- /dev/null +++ b/SixenseSDK/include/sixense_utils/mouse_pointer.hpp @@ -0,0 +1,76 @@ +/* + * + * SIXENSE CONFIDENTIAL + * + * Copyright (C) 2011 Sixense Entertainment Inc. + * All Rights Reserved + * + */ + +#ifndef SIXENSE_UTILS_MOUSE_POINTER_HPP +#define SIXENSE_UTILS_MOUSE_POINTER_HPP + +#pragma warning(push) +#pragma warning( disable:4251 ) + +#include "sixense_utils/export.hpp" +#include "sixense_utils/interfaces.hpp" + +using sixenseMath::Vector2; +using sixenseMath::Vector3; +using sixenseMath::Matrix3; + +namespace sixenseUtils { + + class SIXENSE_UTILS_EXPORT MousePointer : public IMousePointer { + + public: + MousePointer(); + sixenseMath::Vector2 update( sixenseControllerData *cd ); + + void setSensitivity( float sensitivity ); + void setAcceleration( float acceleration ); + void setSlideEnabled( bool slide_enabled ); + void setAspectRatio( float aspect_ratio ); + void setLockRelativeToWindow(bool lock); + void setLockRelativeToClientBounds(bool client); + + Vector2 getMouseOffset() { return mouse_offset; } + void setMouseOffset( Vector2 offset ) { mouse_offset = offset; } + float getRollAngle(); + + void setCenter(); + void setWindowCenter(); + + private: + bool _slide_enabled; + float _aspect_ratio; + float _sensitivity; + float _screen_width_in_mm; + + // velocity params + float _min_vel, _max_vel; + float _acceleration; + + // This offset is the position of the center of the virtual screen relative to the base + Vector2 mouse_offset; + + // Keep track of the previous mouse pos so we can compute velocity + Vector2 _last_mouse_pos; + + // Keep track of the last accel so we can filter it + float _last_accel; + + float _roll_angle; + + bool _center_mouse_requested; + bool _center_mouse_on_window; + + bool _lock_relative_to_window; + bool _lock_relative_using_client_bounds; + }; +} + +#pragma warning(pop) + +#endif |
