23 #include <plugin/common/Logs.h>
39 const std::string CAMERA_CYLINDRIC =
"cylindric";
40 const std::string CAMERA_CYLINDRIC_STEREO =
"cylindricStereo";
41 const std::string CAMERA_CYLINDRIC_STEREO_TRACKED =
"cylindricStereoTracked";
43 constexpr uint32_t openDeckWallResX = 11940u;
44 constexpr uint32_t openDeckWallResY = 3424u;
45 constexpr uint32_t openDeckFloorResX = 4096u;
46 constexpr uint32_t openDeckFloorResY = 2125u;
48 constexpr
char leftWallBufferName[] =
"0L";
49 constexpr
char rightWallBufferName[] =
"0R";
50 constexpr
char leftFloorBufferName[] =
"1L";
51 constexpr
char rightFloorBufferName[] =
"1R";
53 const std::string HEAD_POSITION_PROP =
"headPosition";
54 const std::string HEAD_ROTATION_PROP =
"headRotation";
56 constexpr std::array<double, 3> HEAD_INIT_POS{{0.0, 2.0, 0.0}};
57 constexpr std::array<double, 4> HEAD_INIT_ROT{{0.0, 0.0, 0.0, 1.0}};
59 Property getHeadPositionProperty()
61 Property headPosition{HEAD_POSITION_PROP, HEAD_INIT_POS};
62 headPosition.markReadOnly();
66 Property getHeadRotationProperty()
68 Property headRotation{HEAD_ROTATION_PROP, HEAD_INIT_ROT};
69 headRotation.markReadOnly();
73 Property getStereoModeProperty()
77 {
"None",
"Left eye",
"Right eye",
"Side by side"},
81 Property getInterpupillaryDistanceProperty()
83 return CAMERA_PROPERTY_INTERPUPILLARY_DISTANCE;
86 Property getCameraScalingProperty(
const double scaling)
91 PropertyMap getCylindricStereoProperties()
93 PropertyMap properties;
94 properties.setProperty(getStereoModeProperty());
95 properties.setProperty(getInterpupillaryDistanceProperty());
99 PropertyMap getCylindricStereoTrackedProperties(
const OpenDeckParameters& params)
101 PropertyMap properties;
102 properties.setProperty(getHeadPositionProperty());
103 properties.setProperty(getHeadRotationProperty());
104 properties.setProperty(getStereoModeProperty());
105 properties.setProperty(getInterpupillaryDistanceProperty());
106 properties.setProperty(getCameraScalingProperty(params.getCameraScaling()));
116 throw std::runtime_error(
117 "The scale of the native OpenDeck resolution cannot be bigger "
118 "than 1.0, zero or negative.");
121 throw std::runtime_error(
"The camera scale cannot be zero or negative");
135 const auto& engineName = params.getEngine();
137 if (engineName == ENGINE_OSPRAY)
139 engine.addCameraType(CAMERA_CYLINDRIC);
140 engine.addCameraType(CAMERA_CYLINDRIC_STEREO, getCylindricStereoProperties());
141 engine.addCameraType(CAMERA_CYLINDRIC_STEREO_TRACKED, getCylindricStereoTrackedProperties(_params));
143 engine.addFrameBuffer(frameBuffer);
145 engine.addFrameBuffer(frameBuffer);
147 engine.addFrameBuffer(frameBuffer);
149 engine.addFrameBuffer(frameBuffer);
153 if (engineName == ENGINE_OPTIX_6)
156 context.
addCamera(CAMERA_CYLINDRIC_STEREO, std::make_shared<core::engine::optix::OptiXCylindricStereoCamera>());
157 engine.addCameraType(CAMERA_CYLINDRIC_STEREO, getCylindricStereoProperties());
166 PLUGIN_INFO(
" _| _| _|_|_| _|_| _|_|_| _| _| _|_| _|_|_| _| _| ");
167 PLUGIN_INFO(
" _| _| _| _| _|_|_|_| _| _| _| _| _|_|_|_| _| _|_| ");
168 PLUGIN_INFO(
" _| _| _| _| _| _| _| _| _| _| _| _| _| ");
169 PLUGIN_INFO(
" _|_| _|_|_| _|_|_| _| _| _|_|_| _|_|_| _|_|_| _| _|");
181 catch (
const std::runtime_error& exc)
PLATFORM_API const auto & getParametersManager() const
Returns the parameter manager.
double getResolutionScaling() const
double getCameraScaling() const
const PropertyMap & getPropertyMap() const
OpenDeckPlugin(const OpenDeckParameters ¶ms)
virtual Engine & getEngine()=0
bool parse(int argc, const char **argv)
void addCamera(const std::string &name, OptiXCameraProgramPtr program)
static OptiXContext & get()
std::shared_ptr< FrameBuffer > FrameBufferPtr
core::ExtensionPlugin * core_plugin_create(const int argc, const char **argv)
constexpr auto PARAM_CAMERA_SCALING
glm::vec< 2, uint32_t > Vector2ui