gz/rendering/Camera.hh
virtual void Update()=0
Renders a new frame. This is a convenience function for single-camera scenes. It wraps the pre-render...
virtual void Copy(Image &_image) const =0
Writes the last rendered image to the given image buffer. This function can be called multiple times ...
Represents a scene sensor. The most obvious example is a camera, but it can be anything that generate...
Definition: gz/rendering/Sensor.hh:32
STL class.
virtual RenderPassPtr RenderPassByIndex(unsigned int _index) const =0
Get a render passes by index.
PixelFormat
Image pixel format types.
Definition: gz/rendering/PixelFormat.hh:32
virtual void PostRender()=0
Preforms any necessary final rendering work. Once rendering is complete the camera will alert any lis...
virtual void SetProjectionMatrix(const math::Matrix4d &_matrix)=0
Set the projection matrix for this camera. This overrides the standard projection matrix computed bas...
virtual NodePtr FollowTarget() const =0
Get the target node being followed.
std::function< void(const void *, unsigned int, unsigned int, unsigned int, const std::string &)> NewFrameListener
Callback function for new frame render event listeners.
Definition: gz/rendering/Camera.hh:54
virtual void SetTrackPGain(const double _pGain)=0
Set track P Gain. Determines how fast the camera rotates to look at the target node....
virtual double FollowPGain() const =0
Get the camera follow movement P gain.
Encapsulates a raw image buffer and relevant properties.
Definition: gz/rendering/Image.hh:36
virtual double NearClipPlane() const =0
Get the camera's near clipping plane distance.
virtual PixelFormat ImageFormat() const =0
Get the image pixel format. If the image pixel format has not been set with a valid value,...
virtual math::Vector3d FollowOffset() const =0
Get the follow offset vector in the frame specified at the time the follow target is set.
Posable camera used for rendering the scene graph.
Definition: gz/rendering/Camera.hh:49
virtual VisualPtr VisualAt(const gz::math::Vector2i &_mousePos)=0
Get the visual for a given mouse position param[in] _mousePos mouse position.
CameraProjectionType
Enum for projection types.
Definition: gz/rendering/Camera.hh:39
virtual void SetTrackTarget(const NodePtr &_target, const math::Vector3d &_offset=math::Vector3d::Zero, const bool _worldFrame=false)=0
Set a node for camera to track. The camera will automatically change its orientation to face the targ...
virtual void AddRenderPass(const RenderPassPtr &_pass)=0
Add a render pass to the camera.
virtual RenderWindowPtr CreateRenderWindow()=0
Create a render window.
virtual double AspectRatio() const =0
Get the camera's aspect ratio.
virtual unsigned int ImageHeight() const =0
Get the image height in pixels.
static const Vector3 Zero
virtual void SetFollowPGain(const double _pGain)=0
Set follow P Gain. Determines how fast the camera moves to follow the target node....
virtual void RemoveRenderPass(const RenderPassPtr &_pass)=0
Remove a render pass from the camera.
virtual ~Camera()
Deconstructor.
Definition: gz/rendering/Camera.hh:57
virtual unsigned int ImageWidth() const =0
Get the image width in pixels.
@ CPT_PERSPECTIVE
Perspective projection.
Definition: gz/rendering/Camera.hh:42
virtual unsigned int RenderTextureGLId() const =0
Get the OpenGL texture id associated with the render texture used by this camera. A valid id is retur...
virtual void Capture(Image &_image)=0
Renders a new frame and writes the results to the given image. This is a convenience function for sin...
virtual NodePtr TrackTarget() const =0
Get the target node being tracked.
virtual Image CreateImage() const =0
Created an empty image buffer for capturing images. The resulting image will have sufficient memory a...
virtual void SetFollowTarget(const NodePtr &_target, const math::Vector3d &_offset=math::Vector3d::Zero, const bool _worldFrame=false)=0
Set a node for camera to follow. The camera will automatically update its position to keep itself at ...
virtual math::Angle HFOV() const =0
Get the camera's horizontal field-of-view.
virtual void SetImageWidth(unsigned int _width)=0
Set the image width in pixels.
virtual void SetTrackOffset(const math::Vector3d &_offset)=0
Set track offset. Camera will track a point that's at an offset from the target node....
virtual void SetAspectRatio(const double _ratio)=0
Set the camera's aspect ratio. This value determines the cameras vertical field-of-view....
virtual unsigned int ImageMemorySize() const =0
Get the total image memory size in bytes.
virtual math::Matrix4d ViewMatrix() const =0
Get the view matrix for this camera.
virtual double FarClipPlane() const =0
Get the camera's far clipping plane distance.
virtual double TrackPGain() const =0
Get the camera track rotation P gain.
@ CPT_ORTHOGRAPHIC
Orthographic projection.
Definition: gz/rendering/Camera.hh:44
virtual math::Vector3d TrackOffset() const =0
Get the track offset vector in the frame specified at the time the track target is set.
virtual void Render()=0
Renders the current scene using this camera. This function assumes PreRender() has already been calle...
virtual void SetImageHeight(unsigned int _height)=0
Set the image height in pixels.
virtual common::ConnectionPtr ConnectNewImageFrame(NewFrameListener _listener)=0
Subscribes a new listener to this camera's new frame event.
virtual void SetShadowsDirty()=0
virtual unsigned int RenderPassCount() const =0
Get the number of render passes applied to the camera.
virtual void SetAntiAliasing(const unsigned int _aa)=0
Set the level of anti-aliasing used during rendering. If a value of 0 is given, no anti-aliasing will...
virtual math::Vector2i Project(const math::Vector3d &_pt) const =0
Project point in 3d world space to 2d screen space.
virtual math::Matrix4d ProjectionMatrix() const =0
Get the projection matrix for this camera.
virtual void SetMaterial(const MaterialPtr &_material)=0
Set a material that the camera should see on all objects.
virtual void SetImageFormat(PixelFormat _format)=0
Set the image pixel format.
virtual CameraProjectionType ProjectionType() const =0
Get the projection type for this camera.
virtual void SetFarClipPlane(const double _far)=0
Set the camera's far clipping plane distance.
virtual void SetFollowOffset(const math::Vector3d &_offset)=0
Set offset of camera from target node being followed. The offset will be in the frame that is specifi...
virtual void SetNearClipPlane(const double _near)=0
Set the camera's near clipping plane distance.
virtual unsigned int AntiAliasing() const =0
Get the level of anti-aliasing used during rendering.
virtual bool SaveFrame(const std::string &_name)=0
Writes the previously rendered frame to a file. This function can be called multiple times after Post...
virtual void SetProjectionType(CameraProjectionType _type)=0
Set the projection type for this camera This changes the projection matrix of the camera based on the...
virtual void SetHFOV(const math::Angle &_hfov)=0
Set the camera's horizontal field-of-view.