iMSTK
Interactive Medical Simulation Toolkit
imstkCameraController.h
1 /*
2 ** This file is part of the Interactive Medical Simulation Toolkit (iMSTK)
3 ** iMSTK is distributed under the Apache License, Version 2.0.
4 ** See accompanying NOTICE for details.
5 */
6 
7 #pragma once
8 
9 #include "imstkTrackingDeviceControl.h"
10 
11 namespace imstk
12 {
13 class Camera;
14 
22 {
23 public:
24  CameraController(const std::string& name = "CameraController") : TrackingDeviceControl(name) { }
25  ~CameraController() override = default;
26 
27  std::shared_ptr<Camera> getCamera() const { return m_camera; }
28  void setCamera(std::shared_ptr<Camera> cam) { m_camera = cam; }
29 
34 
38  void update(const double& dt) override;
39 
40 protected:
41  std::shared_ptr<Camera> m_camera;
42 };
43 } // namespace imstk
std::shared_ptr< Camera > m_camera
Camera controlled by the external device.
void update(const double &dt) override
Updates the view of the provided camera.
Compound Geometry.
Directly controls a camera given the device client pose, could be unsmooth depending on device...
Base class for all DeviceControls that track something in space (position and orientation) ...
void setOffsetUsingCurrentCameraPose()
Set the offsets based on the current camera pose.