9 #include "imstkDeviceControl.h" 10 #include "imstkMath.h" 19 using namespace imstk;
39 void setTranslateSpeedScale(
const double translateSpeedScale)
41 m_translateSpeedScale = translateSpeedScale;
50 void setRotateSpeedScale(
const double rotateSpeedScale)
52 m_rotateSpeedScale = rotateSpeedScale;
61 void setVerticalSpeedScale(
double verticalSpeed)
63 m_translateVerticalSpeedScale = verticalSpeed;
72 void setTranslateDevice(std::shared_ptr<OpenVRDeviceClient> translateDevice)
74 m_translateDevice = translateDevice;
82 std::shared_ptr<OpenVRDeviceClient>
getRotateDevice()
const {
return m_rotateDevice; }
83 void setRotateDevice(std::shared_ptr<OpenVRDeviceClient> rotateDevice)
85 m_rotateDevice = rotateDevice;
90 const Mat4d& getDeltaTransform() {
return m_deltaTransform; }
95 void setCamera(std::shared_ptr<Camera> camera) { m_camera = camera; }
96 std::shared_ptr<Camera> getCamera()
const {
return m_camera; }
99 void printControls()
override;
104 void update(
const double& dt)
override;
107 std::shared_ptr<OpenVRDeviceClient> m_translateDevice =
nullptr;
108 std::shared_ptr<OpenVRDeviceClient> m_rotateDevice =
nullptr;
110 std::shared_ptr<Camera> m_camera =
nullptr;
113 double m_rotateSpeedScale = 1.0;
114 double m_translateSpeedScale = 1.0;
115 double m_translateVerticalSpeedScale = 1.0;
116 Mat4d m_deltaTransform = Mat4d::Identity();
While the DeviceClient provides quantities from the device, the control defines what to do with those...
std::shared_ptr< OpenVRDeviceClient > getRotateDevice() const
Get/Set the device that can rotate the camera around Y.
double getTranslateSpeedScale() const
Get/Set how fast the camera translates along XZ plane.
double getVerticalSpeedScale() const
Get/Set the vertical speed, how fast you move along Y.
double getRotateSpeedScale() const
Get/Set how fast the camera rotates around Y.
This class provides quantities for the specified VR device The devices creation is tied to the viewer...
void setCamera(std::shared_ptr< Camera > camera)
Get/Set the camera to be controlled.
std::shared_ptr< OpenVRDeviceClient > getTranslateDevice() const
Get/Set the device that can translate the camera along XZ.
Produces a perpsective transformation matrix.
Scene manager module manages multiple scenes and runs the active one.
Defines a control scheme to move the camera with joysticks. Relative to world space with Y up...