7 #include "imstkCameraController.h" 8 #include "imstkCamera.h" 9 #include "imstkLogger.h" 18 LOG(WARNING) <<
"warning: could not update tracking info.";
31 m_camera->setFocalPoint((r * Vec3d(0.0, 0.0, -1.0)) + p);
32 m_camera->setViewUp(r * Vec3d(0.0, 1.0, 0.0));
38 const auto pos =
m_camera->getPosition();
39 const auto focus =
m_camera->getFocalPoint();
44 auto viewNormal = (pos - focus).normalized();
45 auto viewSide = viewUp.cross(viewNormal).normalized();
46 viewUp = viewNormal.cross(viewSide);
48 rot.col(0) = viewSide;
50 rot.col(2) = viewNormal;
Vec3d m_translationOffset
Translation concatenated to the device translation.
std::shared_ptr< Camera > m_camera
Camera controlled by the external device.
virtual bool updateTrackingData(const double dt)
Update tracking data.
void update(const double &dt) override
Updates the view of the provided camera.
const Quatd & getOrientation() const
Set/Get the orientation of the tracker.
Quatd m_rotationOffset
Rotation concatenated to the device rotation.
const Vec3d & getPosition() const
Set/Get the position of the tracker.
void setOffsetUsingCurrentCameraPose()
Set the offsets based on the current camera pose.