gz/rendering/base/BaseCamera.hh
Go to the documentation of this file.
T atan(T... args)
double Degree() const
void Transpose()
void SetTranslation(const Vector3< T > &_t)
static Matrix4< T > LookAt(const Vector3< T > &_eye, const Vector3< T > &_target, const Vector3< T > &_up=Vector3< T >::UnitZ)
Quaternion< T > & Rot()
Vector3< T > & Pos()
static const Quaternion Identity
static Quaternion< T > Slerp(T _fT, const Quaternion< T > &_rkP, const Quaternion< T > &_rkQ, bool _shortestPath=false)
T & X()
T & Y()
T & Z()
T & X()
T & Y()
Definition: gz/rendering/base/BaseCamera.hh:47
virtual void RemoveRenderPass(const RenderPassPtr &_pass) override
Remove a render pass from the camera.
Definition: gz/rendering/base/BaseCamera.hh:820
virtual void SetImageWidth(const unsigned int _width) override
Set the image width in pixels.
Definition: gz/rendering/base/BaseCamera.hh:286
virtual void SetHFOV(const math::Angle &_hfov) override
Set the camera's horizontal field-of-view.
Definition: gz/rendering/base/BaseCamera.hh:643
virtual math::Angle HFOV() const override
Get the camera's horizontal field-of-view.
Definition: gz/rendering/base/BaseCamera.hh:627
virtual unsigned int ImageWidth() const override
Get the image width in pixels.
Definition: gz/rendering/base/BaseCamera.hh:279
virtual unsigned int RenderPassCount() const override
Get the number of render passes applied to the camera.
Definition: gz/rendering/base/BaseCamera.hh:827
NodePtr trackNode
Target node to track if camera tracking is on.
Definition: gz/rendering/base/BaseCamera.hh:229
virtual void AddRenderPass(const RenderPassPtr &_pass) override
Add a render pass to the camera.
Definition: gz/rendering/base/BaseCamera.hh:813
virtual unsigned int AntiAliasing() const override
Get the level of anti-aliasing used during rendering.
Definition: gz/rendering/base/BaseCamera.hh:664
virtual double AspectRatio() const override
Get the camera's aspect ratio.
Definition: gz/rendering/base/BaseCamera.hh:650
virtual NodePtr FollowTarget() const override
Get the target node being followed.
Definition: gz/rendering/base/BaseCamera.hh:761
virtual void SetProjectionType(CameraProjectionType _type) override
Set the projection type for this camera This changes the projection matrix of the camera based on the...
Definition: gz/rendering/base/BaseCamera.hh:594
virtual void SetTrackTarget(const NodePtr &_target, const math::Vector3d &_offset, const bool _worldFrame) override
Set a node for camera to track. The camera will automatically change its orientation to face the targ...
Definition: gz/rendering/base/BaseCamera.hh:706
virtual void Copy(Image &_image) const override
Writes the last rendered image to the given image buffer. This function can be called multiple times ...
Definition: gz/rendering/base/BaseCamera.hh:435
virtual double FarClipPlane() const override
Get the camera's far clipping plane distance.
Definition: gz/rendering/base/BaseCamera.hh:678
math::Matrix4d projectionMatrix
Custom projection matrix.
Definition: gz/rendering/base/BaseCamera.hh:257
virtual NodePtr TrackTarget() const override
Get the target node being tracked.
Definition: gz/rendering/base/BaseCamera.hh:716
virtual void SetTrackPGain(const double _pGain) override
Set track P Gain. Determines how fast the camera rotates to look at the target node....
Definition: gz/rendering/base/BaseCamera.hh:737
virtual void SetNearClipPlane(const double _near) override
Set the camera's near clipping plane distance.
Definition: gz/rendering/base/BaseCamera.hh:699
virtual void PreRender() override
Prepare this object and any of its children for rendering. This should be called for each object in a...
Definition: gz/rendering/base/BaseCamera.hh:335
virtual double FollowPGain() const override
Get the camera follow movement P gain.
Definition: gz/rendering/base/BaseCamera.hh:789
virtual void SetAspectRatio(const double _ratio) override
Set the camera's aspect ratio. This value determines the cameras vertical field-of-view....
Definition: gz/rendering/base/BaseCamera.hh:657
virtual void Reset()
Definition: gz/rendering/base/BaseCamera.hh:473
NodePtr followNode
Target node to follow.
Definition: gz/rendering/base/BaseCamera.hh:243
virtual void SetMaterial(const MaterialPtr &_material) override
Set a material that the camera should see on all objects.
Definition: gz/rendering/base/BaseCamera.hh:796
virtual void SetImageHeight(const unsigned int _height) override
Set the image height in pixels.
Definition: gz/rendering/base/BaseCamera.hh:302
virtual math::Vector3d FollowOffset() const override
Get the follow offset vector in the frame specified at the time the follow target is set.
Definition: gz/rendering/base/BaseCamera.hh:768
virtual PixelFormat ImageFormat() const override
Get the image pixel format. If the image pixel format has not been set with a valid value,...
Definition: gz/rendering/base/BaseCamera.hh:321
virtual void Capture(Image &_image) override
Renders a new frame and writes the results to the given image. This is a convenience function for sin...
Definition: gz/rendering/base/BaseCamera.hh:427
common::EventT< void(const void *, unsigned int, unsigned int, unsigned int, const std::string &)> newFrameEvent
Definition: gz/rendering/base/BaseCamera.hh:209
virtual CameraProjectionType ProjectionType() const override
Get the projection type for this camera.
Definition: gz/rendering/base/BaseCamera.hh:601
virtual void SetImageFormat(PixelFormat _format) override
Set the image pixel format.
Definition: gz/rendering/base/BaseCamera.hh:328
virtual unsigned int RenderTextureGLId() const override
Get the OpenGL texture id associated with the render texture used by this camera. A valid id is retur...
Definition: gz/rendering/base/BaseCamera.hh:804
virtual math::Vector3d TrackOffset() const override
Get the track offset vector in the frame specified at the time the track target is set.
Definition: gz/rendering/base/BaseCamera.hh:723
virtual void SetAntiAliasing(const unsigned int _aa) override
Set the level of anti-aliasing used during rendering. If a value of 0 is given, no anti-aliasing will...
Definition: gz/rendering/base/BaseCamera.hh:671
virtual double NearClipPlane() const override
Get the camera's near clipping plane distance.
Definition: gz/rendering/base/BaseCamera.hh:692
virtual void SetProjectionMatrix(const math::Matrix4d &_matrix) override
Set the projection matrix for this camera. This overrides the standard projection matrix computed bas...
Definition: gz/rendering/base/BaseCamera.hh:568
virtual math::Vector2i Project(const math::Vector3d &_pt) const override
Project point in 3d world space to 2d screen space.
Definition: gz/rendering/base/BaseCamera.hh:608
virtual bool SaveFrame(const std::string &_name) override
Writes the previously rendered frame to a file. This function can be called multiple times after Post...
Definition: gz/rendering/base/BaseCamera.hh:442
math::Angle hfov
Horizontal camera field of view.
Definition: gz/rendering/base/BaseCamera.hh:223
virtual RenderPassPtr RenderPassByIndex(unsigned int _index) const override
Get a render passes by index.
Definition: gz/rendering/base/BaseCamera.hh:834
virtual RenderTargetPtr RenderTarget() const =0
virtual math::Matrix4d ViewMatrix() const override
Get the view matrix for this camera.
Definition: gz/rendering/base/BaseCamera.hh:575
BaseCamera()
Definition: gz/rendering/base/BaseCamera.hh:267
virtual void SetTrackOffset(const math::Vector3d &_offset) override
Set track offset. Camera will track a point that's at an offset from the target node....
Definition: gz/rendering/base/BaseCamera.hh:730
math::Vector3d followOffset
Offset distance between camera and target node being followed.
Definition: gz/rendering/base/BaseCamera.hh:254
virtual void * CreateImageBuffer() const
Definition: gz/rendering/base/BaseCamera.hh:457
virtual void SetFarClipPlane(const double _far) override
Set the camera's far clipping plane distance.
Definition: gz/rendering/base/BaseCamera.hh:685
virtual void Update() override
Renders a new frame. This is a convenience function for single-camera scenes. It wraps the pre-render...
Definition: gz/rendering/base/BaseCamera.hh:414
virtual void SetFollowTarget(const NodePtr &_target, const math::Vector3d &_Offset, const bool _worldFrame) override
Set a node for camera to follow. The camera will automatically update its position to keep itself at ...
Definition: gz/rendering/base/BaseCamera.hh:751
virtual void Load() override
Definition: gz/rendering/base/BaseCamera.hh:466
virtual ~BaseCamera()
Definition: gz/rendering/base/BaseCamera.hh:273
virtual common::ConnectionPtr ConnectNewImageFrame(Camera::NewFrameListener _listener) override
Subscribes a new listener to this camera's new frame event.
Definition: gz/rendering/base/BaseCamera.hh:449
virtual void SetFollowOffset(const math::Vector3d &_offset) override
Set offset of camera from target node being followed. The offset will be in the frame that is specifi...
Definition: gz/rendering/base/BaseCamera.hh:775
math::Vector3d trackOffset
Set camera to track a point offset in target node's local or world frame depending on trackWorldFrame...
Definition: gz/rendering/base/BaseCamera.hh:236
virtual VisualPtr VisualAt(const gz::math::Vector2i &_mousePos) override
Get the visual for a given mouse position param[in] _mousePos mouse position.
Definition: gz/rendering/base/BaseCamera.hh:634
virtual void PostRender() override
Preforms any necessary final rendering work. Once rendering is complete the camera will alert any lis...
Definition: gz/rendering/base/BaseCamera.hh:397
virtual RenderWindowPtr CreateRenderWindow() override
Create a render window.
Definition: gz/rendering/base/BaseCamera.hh:489
virtual unsigned int ImageMemorySize() const override
Get the total image memory size in bytes.
Definition: gz/rendering/base/BaseCamera.hh:311
virtual unsigned int ImageHeight() const override
Get the image height in pixels.
Definition: gz/rendering/base/BaseCamera.hh:295
virtual Image CreateImage() const override
Created an empty image buffer for capturing images. The resulting image will have sufficient memory a...
Definition: gz/rendering/base/BaseCamera.hh:404
virtual double TrackPGain() const override
Get the camera track rotation P gain.
Definition: gz/rendering/base/BaseCamera.hh:744
virtual void SetShadowsDirty() override
Definition: gz/rendering/base/BaseCamera.hh:841
ImagePtr imageBuffer
Definition: gz/rendering/base/BaseCamera.hh:211
virtual math::Matrix4d ProjectionMatrix() const override
Get the projection matrix for this camera.
Definition: gz/rendering/base/BaseCamera.hh:499
virtual void SetFollowPGain(const double _pGain) override
Set follow P Gain. Determines how fast the camera moves to follow the target node....
Definition: gz/rendering/base/BaseCamera.hh:782
Definition: gz/rendering/base/BaseDepthCamera.hh:37
Posable camera used for rendering the scene graph.
Definition: gz/rendering/Camera.hh:51
Encapsulates a raw image buffer and relevant properties.
Definition: gz/rendering/Image.hh:37
virtual void PreRender()=0
Prepare this object and any of its children for rendering. This should be called for each object in a...
virtual void PostRender()=0
Post process this object and any of its children after rendering.
static unsigned int MemorySize(PixelFormat _format, unsigned int _width, unsigned int _height)
Get total memory size in bytes for an image with the given format and dimensions. If an invalid forma...
virtual std::string Name() const =0
Get name of the render-engine.
Represents a render-target to which cameras can render images.
Definition: gz/rendering/RenderTarget.hh:39
virtual void RemoveRenderPass(const RenderPassPtr &_pass)=0
Remove a render pass from the render target.
virtual RenderPassPtr RenderPassByIndex(unsigned int _index) const =0
Get a render pass by index.
virtual void AddRenderPass(const RenderPassPtr &_pass)=0
Add a render pass to the render target.
virtual void SetHeight(const unsigned int _height)=0
Set the render target height in pixels.
virtual void SetFormat(PixelFormat _format)=0
Set the render target image format.
virtual unsigned int RenderPassCount() const =0
Get the number of render passes applied to the render target.
virtual unsigned int Height() const =0
Get render target height in pixels.
virtual void Copy(Image &_image) const =0
Write rendered image to given Image. The RenderTarget will convert the underlying image to the specif...
virtual unsigned int Width() const =0
Get render target width in pixels.
virtual PixelFormat Format() const =0
Set the render target image format.
virtual void SetWidth(const unsigned int _width)=0
Set the render target width in pixels.
Manages a single scene-graph. This class updates scene-wide properties and holds the root scene node....
Definition: gz/rendering/Scene.hh:50
virtual RenderEngine * Engine() const =0
Get the creating render-engine of the scene.
virtual void PreRender()=0
Prepare scene for rendering. The scene will flushing any scene changes by traversing scene-graph,...
virtual void PostRender()=0
Call this function after you're done updating ALL cameras.
T endl(T... args)
#define ignerr
#define IGN_COMMON_WARN_IGNORE__DLL_INTERFACE_MISSING
#define IGN_COMMON_WARN_RESUME__DLL_INTERFACE_MISSING
Pose3< double > Pose3d
bool equal(const T &_a, const T &_b, const T &_epsilon=T(1e-6))
T clamp(T _v, T _min, T _max)
CameraProjectionType
Enum for projection types.
Definition: gz/rendering/Camera.hh:40
@ CPT_PERSPECTIVE
Perspective projection.
Definition: gz/rendering/Camera.hh:42
@ CPT_ORTHOGRAPHIC
Orthographic projection.
Definition: gz/rendering/Camera.hh:44
PixelFormat
Image pixel format types.
Definition: gz/rendering/PixelFormat.hh:33
@ PF_R8G8B8
< RGB, 1-byte per channel
Definition: gz/rendering/PixelFormat.hh:39
shared_ptr< RenderWindow > RenderWindowPtr
Shared pointer to RenderWindow.
Definition: gz/rendering/RenderTypes.hh:243
shared_ptr< Visual > VisualPtr
Shared pointer to Visual.
Definition: gz/rendering/RenderTypes.hh:269
T tan(T... args)