26#include <osg/Geometry>
27#include <osg/Texture2D>
48 COLOR_BUFFER=osg::Camera::COLOR_BUFFER,
49 DEPTH_BUFFER=osg::Camera::DEPTH_BUFFER
57 DEPTH_COMPONENT= GL_DEPTH_COMPONENT
62 DO_NOT_COMPUTE_NEAR_FAR=osg::Camera::DO_NOT_COMPUTE_NEAR_FAR,
63 COMPUTE_NEAR_FAR_USING_BOUNDING_VOLUMES=osg::Camera::COMPUTE_NEAR_FAR_USING_BOUNDING_VOLUMES,
64 COMPUTE_NEAR_FAR_USING_PRIMITIVES=osg::Camera::COMPUTE_NEAR_FAR_USING_PRIMITIVES,
65 COMPUTE_NEAR_USING_PRIMITIVES=osg::Camera::COMPUTE_NEAR_USING_PRIMITIVES
191 class CameraSynchronizeCallback;
203 class
RenderTarget::CameraSynchronizeCallback : public osg::Camera::DrawCallback
206 CameraSynchronizeCallback(
const osg::Camera *reference, osg::Camera *target);
207 virtual ~CameraSynchronizeCallback();
209 virtual void operator () (osg::RenderInfo& )
const;
210 using osg::Camera::DrawCallback::operator();
212 void addNestedCallback(osg::Camera::DrawCallback *child);
215 osg::ref_ptr<const osg::Camera> m_reference;
216 osg::ref_ptr<osg::Camera> m_target;
#define AGX_DECLARE_POINTER_TYPES(type)
#define AGX_DECLARE_VECTOR_TYPES(type)
Render target is used for rendering camera content to a buffer, either a DEPTH or COLOR target.
void setViewMatrixFromOtherCamera(const osg::Camera *camera)
Update the view matrix given the arguments.
TextureFormat
Specifies target texture format.
BufferComponent
Specifies which type of buffer to render.
void setProjectionMatrixAsOrtho(double left, double right, double bottom, double top, double zNear, double zFar)
Update the orthographic projection matrix given the arguments.
void setSize(agx::UInt width, agx::UInt height)
Update the size of the render target buffer size.
osg::Camera * getCamera()
osg::ref_ptr< CameraSynchronizeCallback > m_cameraSynchronizeCallback
ImageCaptureBaseRef m_imageCapture
agx::Vec2 calculateScreenCoords(agx::Vec3 &worldPos)
Transform the position into screen coordinates using the camera associated to this RenderTarget.
void setProjectionMatrixFromOtherCamera(const osg::Camera *camera)
Update the perspective projection matrix from another camera.
void setImageCapture(agxOSG::ImageCaptureBase *imageCapture)
By attaching an ImageCaptureBase you can automatically store the image data to disk given a specific ...
void setComputeNearFarMode(agxOSG::RenderTarget::ComputeNearFarMode mode)
Specifies whether the near far should be automatically updated or not.
void setViewMatrixAsLookAt(const agx::Vec3 &eye, const agx::Vec3 ¢er, const agx::Vec3 &up)
Update the view matrix given the arguments.
osg::ref_ptr< osg::Camera > m_camera
void setReferenceCamera(const osg::Camera *referenceCamera)
By using a reference camera, the render target camera will get the same view/projection/viewpoint as ...
void addPreRenderCallback(osg::Camera::DrawCallback *callback)
Add a pre-render callback to this RenderTarget.
void setProjectionMatrixAsPerspective(double fovy, double aspectRatio, double zNear, double zFar)
Update the perspective projection matrix given the arguments.
int getCameraCullMask() const
RenderTarget(agx::UInt width, agx::UInt height)
Constructor.
agx::Vec2u getSize() const
void setSize(agx::Vec2u size)
Update the size of the render target buffer size.
void setCameraCullMask(int cullMask)
agxOSG::ImageCaptureBase * getImageCapture()
agx::Object is a refcounted object with a name.
#define DOXYGEN_END_INTERNAL_BLOCK()
#define DOXYGEN_START_INTERNAL_BLOCK()
The agxOSG namespace provides functionality for visualizing AGX simulations with OpenSceneGraph.