OculusDisplaySettings.h
Go to the documentation of this file.
// This file is a part of the OpenSurgSim project.
// Copyright 2015, SimQuest Solutions Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef SURGSIM_DEVICES_OCULUS_OCULUSDISPLAYSETTINGS_H
#define SURGSIM_DEVICES_OCULUS_OCULUSDISPLAYSETTINGS_H
#include <osg/DisplaySettings>
#include "SurgSim/Math/Matrix.h"
namespace SurgSim
{
namespace Devices
{
class OculusDisplaySettings : public osg::DisplaySettings
{
public:
OculusDisplaySettings();
explicit OculusDisplaySettings(const osg::DisplaySettings* displaySettings);
void setLeftEyeProjectionMatrix(const SurgSim::Math::Matrix44d& matrix);
SurgSim::Math::Matrix44d getLeftEyeProjectionMatrix() const;
void setRightEyeProjectionMatrix(const SurgSim::Math::Matrix44d& matrix);
SurgSim::Math::Matrix44d getRightEyeProjectionMatrix() const;
osg::Matrixd computeLeftEyeProjectionImplementation(const osg::Matrixd&) const override;
osg::Matrixd computeRightEyeProjectionImplementation(const osg::Matrixd&) const override;
private:
osg::Matrixd m_leftEyeProjectionMatrix;
osg::Matrixd m_rightEyeProjectionMatrix;
};
}; // namespace Devices
}; // namespace SurgSim
#endif // SURGSIM_DEVICES_OCULUS_OCULUSDISPLAYSETTINGS_H
SurgSim
Definition: CompoundShapeToGraphics.cpp:29
SurgSim::Devices::OculusDisplaySettings::m_rightEyeProjectionMatrix
osg::Matrixd m_rightEyeProjectionMatrix
Right eye projection matrix.
Definition: OculusDisplaySettings.h:71
SurgSim::Devices::OculusDisplaySettings::computeRightEyeProjectionImplementation
osg::Matrixd computeRightEyeProjectionImplementation(const osg::Matrixd &) const override
This method returns the projection matrix set by setRighttEyeProjectionMatrix() method.
Definition: OculusDisplaySettings.cpp:62
SurgSim::Math::Matrix44d
Eigen::Matrix< double, 4, 4, Eigen::RowMajor > Matrix44d
A 4x4 matrix of doubles.
Definition: Matrix.h:55
SurgSim::Devices::OculusDisplaySettings::setLeftEyeProjectionMatrix
void setLeftEyeProjectionMatrix(const SurgSim::Math::Matrix44d &matrix)
Set the projection matrix of the left eye.
Definition: OculusDisplaySettings.cpp:37
SurgSim::Devices::OculusDisplaySettings::getLeftEyeProjectionMatrix
SurgSim::Math::Matrix44d getLeftEyeProjectionMatrix() const
Get the projection matrix of the left eye.
Definition: OculusDisplaySettings.cpp:42
SurgSim::Devices::OculusDisplaySettings::computeLeftEyeProjectionImplementation
osg::Matrixd computeLeftEyeProjectionImplementation(const osg::Matrixd &) const override
This method returns the projection matrix set by setLeftEyeProjectionMatrix() method.
Definition: OculusDisplaySettings.cpp:57
SurgSim::Devices::OculusDisplaySettings
A customized osg::DisplaySettings, to be used with Oculus device.
Definition: OculusDisplaySettings.h:30
SurgSim::Devices::OculusDisplaySettings::m_leftEyeProjectionMatrix
osg::Matrixd m_leftEyeProjectionMatrix
Left eye projection matrix.
Definition: OculusDisplaySettings.h:68
SurgSim::Devices::OculusDisplaySettings::setRightEyeProjectionMatrix
void setRightEyeProjectionMatrix(const SurgSim::Math::Matrix44d &matrix)
Set the projection matrix of the right eye.
Definition: OculusDisplaySettings.cpp:47
SurgSim::Devices::OculusDisplaySettings::getRightEyeProjectionMatrix
SurgSim::Math::Matrix44d getRightEyeProjectionMatrix() const
Get the projection matrix of the right eye.
Definition: OculusDisplaySettings.cpp:52
Matrix.h
Definitions of small fixed-size square matrix types.
SurgSim::Devices::OculusDisplaySettings::OculusDisplaySettings
OculusDisplaySettings()
Constructor.
Definition: OculusDisplaySettings.cpp:25