16 #ifndef SURGSIM_GRAPHICS_OSGCAMERA_H
17 #define SURGSIM_GRAPHICS_OSGCAMERA_H
19 #include <unordered_map>
33 #pragma warning(disable:4250)
62 explicit OsgCamera(
const std::string& name);
66 virtual bool setRenderGroup(std::shared_ptr<Group> group)
override;
68 virtual void setVisible(
bool visible)
override;
80 virtual void update(
double dt)
override;
88 virtual bool setRenderTarget(std::shared_ptr<RenderTarget> renderTarget)
override;
92 virtual bool setMaterial(std::shared_ptr<Material> material)
override;
94 virtual std::shared_ptr<Material>
getMaterial()
const override;
141 #if defined(_MSC_VER)
145 #endif // SURGSIM_GRAPHICS_OSGCAMERA_H
std::unordered_map< int, std::shared_ptr< Texture > > m_textureMap
Definition: OsgCamera.h:112
virtual void setProjectionMatrix(const SurgSim::Math::Matrix44d &matrix) override
Sets the projection matrix of the camera.
Definition: OsgCamera.cpp:144
virtual bool setMaterial(std::shared_ptr< Material > material) override
Sets the material that defines the visual appearance of the representation.
Definition: OsgCamera.cpp:219
Definition: DriveElementFromInputBehavior.cpp:27
SURGSIM_STATIC_REGISTRATION(OsgBoxRepresentation)
virtual std::shared_ptr< RenderTarget > getRenderTarget() const override
Gets RenderTarget that is currently being used by the camera.
Definition: OsgCamera.cpp:213
virtual void clearMaterial() override
Removes the material from the representation.
Definition: OsgCamera.cpp:237
osg::ref_ptr< osg::Camera > m_camera
Definition: OsgCamera.h:106
osg::ref_ptr< osg::Camera > getOsgCamera() const
Definition: OsgCamera.cpp:284
osg::ref_ptr< osg::Group > m_materialProxy
Definition: OsgCamera.h:107
virtual void setRenderOrder(RenderOrder order, int value) override
Determine when this camera will render.
Definition: OsgCamera.cpp:276
OSG implementation of a graphics camera.
Definition: OsgCamera.h:54
Eigen::Matrix< double, 4, 4, Eigen::RowMajor > Matrix44d
A 4x4 matrix of doubles.
Definition: Matrix.h:55
Base graphics camera class, which defines the basic interface for all graphics cameras.
Definition: Camera.h:49
void detachCurrentRenderTarget()
Detach the current render target from the camera.
Definition: OsgCamera.cpp:242
SURGSIM_CLASSNAME(SurgSim::Graphics::OsgCamera)
virtual bool setRenderTarget(std::shared_ptr< RenderTarget > renderTarget) override
Sets RenderTarget for the current camera, enables the camera to render to off-screen textures...
Definition: OsgCamera.cpp:170
virtual std::shared_ptr< Material > getMaterial() const override
Gets the material that defines the visual appearance of the representation.
Definition: OsgCamera.cpp:232
virtual void setVisible(bool visible) override
Sets whether the representation is currently visible.
Definition: OsgCamera.cpp:129
SurgSim::Math::Matrix44d m_projectionMatrix
Projection matrix of the camera.
Definition: OsgCamera.h:110
virtual void update(double dt) override
Updates the representation.
Definition: OsgCamera.cpp:155
std::shared_ptr< OsgUniform< SurgSim::Math::Matrix44f > > m_inverseViewMatrixUniform
Uniform to carry the inverse view matrix.
Definition: OsgCamera.h:127
std::shared_ptr< OsgUniform< SurgSim::Math::Vector4f > > m_ambientColorUniform
Uniform to carry the ambient color.
Definition: OsgCamera.h:130
std::shared_ptr< RenderTarget > m_renderTarget
Definition: OsgCamera.h:113
virtual const SurgSim::Math::Matrix44d & getProjectionMatrix() const override
Gets the projection matrix of the camera.
Definition: OsgCamera.cpp:150
SurgSim::Math::Vector4d m_ambientColor
Value for ambient color.
Definition: OsgCamera.h:133
OsgCamera(const std::string &name)
Constructor.
Definition: OsgCamera.cpp:75
virtual bool isVisible() const override
Gets whether the representation is currently visible.
Definition: OsgCamera.cpp:134
std::shared_ptr< OsgUniform< SurgSim::Math::Matrix44f > > m_viewMatrixUniform
Uniform to carry the view matrix.
Definition: OsgCamera.h:124
virtual void setAmbientColor(const SurgSim::Math::Vector4d &color) override
Sets a value for the ambient lighting term, this can add light to the scene when there is no lighting...
Definition: OsgCamera.cpp:299
void attachRenderTargetTexture(osg::Camera::BufferComponent buffer, std::shared_ptr< Texture > texture)
Attach a specific texture to a specific BufferComponent, works for Depth and all the Colors...
Definition: OsgCamera.cpp:258
virtual SurgSim::Math::Matrix44d getInverseViewMatrix() const
Gets the inverse view matrix of the camera.
Definition: OsgCamera.cpp:294
virtual SurgSim::Math::Vector4d getAmbientColor() override
Definition: OsgCamera.cpp:305
osg::ref_ptr< osg::Node > getOsgNode() const
Definition: OsgCamera.cpp:289
Eigen::Matrix< double, 4, 1 > Vector4d
A 4D vector of doubles.
Definition: Vector.h:60
RenderOrder
Definition: Camera.h:53
virtual bool setRenderGroup(std::shared_ptr< Group > group) override
Sets the group of representations that will be seen by this camera.
Definition: OsgCamera.cpp:109
Base OSG implementation of a graphics representation.
Definition: OsgRepresentation.h:42
virtual SurgSim::Math::Matrix44d getViewMatrix() const
Gets the view matrix of the camera.
Definition: OsgCamera.cpp:139