BaseCamera.hh
Go to the documentation of this file.
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...
T atan(T... args)
virtual void * CreateImageBuffer() const
Definition: BaseCamera.hh:457
virtual unsigned int RenderPassCount() const =0
Get the number of render passes applied to the render target.
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. The offset will be in the frame that is specified at the time the track target is set.
Definition: BaseCamera.hh:730
virtual void SetTrackPGain(const double _pGain) override
Set track P Gain. Determines how fast the camera rotates to look at the target node. Valid range: [0-1].
Definition: BaseCamera.hh:737
T Y() const
Definition: BaseCamera.hh:44
virtual common::ConnectionPtr ConnectNewImageFrame(Camera::NewFrameListener _listener) override
Subscribes a new listener to this camera's new frame event.
Definition: BaseCamera.hh:449
void Degree(double _degree)
virtual double FarClipPlane() const override
Get the camera's far clipping plane distance.
Definition: BaseCamera.hh:678
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: BaseCamera.hh:804
virtual RenderPassPtr RenderPassByIndex(unsigned int _index) const =0
Get a render pass by index.
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: BaseCamera.hh:442
math::Vector3d trackOffset
Set camera to track a point offset in target node's local or world frame depending on trackWorldFrame...
Definition: BaseCamera.hh:240
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: BaseCamera.hh:671
virtual void SetImageHeight(const unsigned int _height) override
Set the image height in pixels.
Definition: BaseCamera.hh:304
T endl(T... args)
virtual void PostRender()=0
Post process this object and any of its children after rendering.
void Transpose()
common::EventT< void(const void *, unsigned int, unsigned int, unsigned int, const std::string &)> newFrameEvent
Definition: BaseCamera.hh:213
virtual void SetImageWidth(const unsigned int _width) override
Set the image width in pixels.
Definition: BaseCamera.hh:290
virtual RenderPassPtr RenderPassByIndex(unsigned int _index) const override
Get a render passes by index.
Definition: BaseCamera.hh:842
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: BaseCamera.hh:751
virtual void SetFormat(PixelFormat _format)=0
Set the render target image format.
CameraProjectionType
Enum for projection types.
Definition: Camera.hh:39
virtual math::Matrix4d ProjectionMatrix() const override
Get the projection matrix for this camera.
Definition: BaseCamera.hh:499
bool equal(const T &_a, const T &_b, const T &_epsilon=T(1e-6))
math::Vector3d followOffset
Offset distance between camera and target node being followed.
Definition: BaseCamera.hh:258
virtual unsigned int AntiAliasing() const override
Get the level of anti-aliasing used during rendering.
Definition: BaseCamera.hh:664
#define IGN_COMMON_WARN_RESUME__DLL_INTERFACE_MISSING
T X() const
virtual double FollowPGain() const override
Get the camera follow movement P gain.
Definition: BaseCamera.hh:789
virtual RenderWindowPtr CreateRenderWindow() override
Create a render window.
Definition: BaseCamera.hh:489
virtual void SetImageFormat(PixelFormat _format) override
Set the image pixel format.
Definition: BaseCamera.hh:328
STL class.
Represents a render-target to which cameras can render images.
Definition: RenderTarget.hh:37
virtual math::Vector3d TrackOffset() const override
Get the track offset vector in the frame specified at the time the track target is set...
Definition: BaseCamera.hh:723
T Y() const
virtual void RemoveRenderPass(const RenderPassPtr &_pass)=0
Remove a render pass from the render target.
virtual NodePtr TrackTarget() const override
Get the target node being tracked.
Definition: BaseCamera.hh:716
virtual double NearClipPlane() const override
Get the camera's near clipping plane distance.
Definition: BaseCamera.hh:692
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: BaseCamera.hh:435
virtual void SetMaterial(const MaterialPtr &_material) override
Set a material that the camera should see on all objects.
Definition: BaseCamera.hh:796
shared_ptr< RenderWindow > RenderWindowPtr
Shared pointer to RenderWindow.
Definition: RenderTypes.hh:238
Definition: BaseCamera.hh:41
T X() const
Encapsulates a raw image buffer and relevant properties.
Definition: Image.hh:36
Pose3< double > Pose3d
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: BaseCamera.hh:427
virtual void RemoveRenderPass(const RenderPassPtr &_pass) override
Remove a render pass from the camera.
Definition: BaseCamera.hh:828
virtual void SetWidth(const unsigned int _width)=0
Set the render target width in pixels.
virtual math::Vector3d FollowOffset() const override
Get the follow offset vector in the frame specified at the time the follow target is set...
Definition: BaseCamera.hh:768
Manages a single scene-graph. This class updates scene-wide properties and holds the root scene node...
Definition: Scene.hh:49
static Quaternion< T > Slerp(T _fT, const Quaternion< T > &_rkP, const Quaternion< T > &_rkQ, bool _shortestPath=false)
virtual unsigned int ImageMemorySize() const override
Get the total image memory size in bytes.
Definition: BaseCamera.hh:311
static const Quaternion Identity
virtual math::Matrix4d ViewMatrix() const override
Get the view matrix for this camera.
Definition: BaseCamera.hh:575
virtual unsigned int RenderPassCount() const override
Get the number of render passes applied to the camera.
Definition: BaseCamera.hh:835
virtual void PreRender() override
Prepare this object and any of its children for rendering. This should be called for each object in a...
Definition: BaseCamera.hh:335
virtual RenderEngine * Engine() const =0
Get the creating render-engine of the scene.
const Quaternion< T > & Rot() const
virtual void SetProjectionMatrix(const math::Matrix4d &_matrix) override
Set the projection matrix for this camera. This overrides the standard projection matrix computed bas...
Definition: BaseCamera.hh:568
Posable camera used for rendering the scene graph.
Definition: Camera.hh:49
virtual void SetHFOV(const math::Angle &_hfov) override
Set the camera's horizontal field-of-view.
Definition: BaseCamera.hh:643
void SetTranslation(const Vector3< T > &_t)
virtual unsigned int ImageWidth() const override
Get the image width in pixels.
Definition: BaseCamera.hh:283
NodePtr trackNode
Target node to track if camera tracking is on.
Definition: BaseCamera.hh:233
virtual double TrackPGain() const override
Get the camera track rotation P gain.
Definition: BaseCamera.hh:744
virtual unsigned int ImageHeight() const override
Get the image height in pixels.
Definition: BaseCamera.hh:297
virtual void PostRender() override
Preforms any necessary final rendering work. Once rendering is complete the camera will alert any lis...
Definition: BaseCamera.hh:397
NodePtr followNode
Target node to follow.
Definition: BaseCamera.hh:247
virtual void AddRenderPass(const RenderPassPtr &_pass) override
Add a render pass to the camera.
Definition: BaseCamera.hh:821
virtual void SetHeight(const unsigned int _height)=0
Set the render target height in pixels.
virtual void SetFarClipPlane(const double _far) override
Set the camera's far clipping plane distance.
Definition: BaseCamera.hh:685
virtual void RenderTextureMetalId(void *_textureIdPtr) const override
Get the Metal texture id associated with the render texture used by this camera. A valid Id is obtain...
Definition: BaseCamera.hh:813
virtual std::string Name() const =0
Get name of the render-engine.
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 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: BaseCamera.hh:706
#define ignerr
const Vector3< T > & Pos() const
virtual void SetFollowPGain(const double _pGain) override
Set follow P Gain. Determines how fast the camera moves to follow the target node. Valid range: [0-1].
Definition: BaseCamera.hh:782
virtual Image CreateImage() const override
Created an empty image buffer for capturing images. The resulting image will have sufficient memory a...
Definition: BaseCamera.hh:404
T tan(T... args)
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: BaseCamera.hh:594
virtual void Copy(Image &_image) const =0
Write rendered image to given Image. The RenderTarget will convert the underlying image to the specif...
math::Matrix4d projectionMatrix
Custom projection matrix.
Definition: BaseCamera.hh:261
virtual void SetAspectRatio(const double _ratio) override
Set the camera's aspect ratio. This value determines the cameras vertical field-of-view. It is often the.
Definition: BaseCamera.hh:657
virtual double AspectRatio() const override
Get the camera's aspect ratio.
Definition: BaseCamera.hh:650
virtual void PreRender()=0
Prepare scene for rendering. The scene will flushing any scene changes by traversing scene-graph...
virtual void Update() override
Renders a new frame. This is a convenience function for single-camera scenes. It wraps the pre-render...
Definition: BaseCamera.hh:414
virtual void PostRender()=0
Call this function after you're done updating ALL cameras.
virtual CameraProjectionType ProjectionType() const override
Get the projection type for this camera.
Definition: BaseCamera.hh:601
virtual VisualPtr VisualAt(const ignition::math::Vector2i &_mousePos) override
Get the visual for a given mouse position param[in] _mousePos mouse position.
Definition: BaseCamera.hh:634
shared_ptr< Visual > VisualPtr
Shared pointer to Visual.
Definition: RenderTypes.hh:264
virtual void AddRenderPass(const RenderPassPtr &_pass)=0
Add a render pass to the render target.
virtual void SetNearClipPlane(const double _near) override
Set the camera's near clipping plane distance.
Definition: BaseCamera.hh:699
virtual void SetShadowsDirty() override
Definition: BaseCamera.hh:849
virtual unsigned int Width() const =0
Get render target width in pixels.
virtual PixelFormat ImageFormat() const override
Get the image pixel format. If the image pixel format has not been set with a valid value...
Definition: BaseCamera.hh:321
static Matrix4< T > LookAt(const Vector3< T > &_eye, const Vector3< T > &_target, const Vector3< T > &_up=Vector3< T >::UnitZ)
virtual math::Angle HFOV() const override
Get the camera's horizontal field-of-view.
Definition: BaseCamera.hh:627
virtual math::Vector2i Project(const math::Vector3d &_pt) const override
Project point in 3d world space to 2d screen space.
Definition: BaseCamera.hh:608
virtual NodePtr FollowTarget() const override
Get the target node being followed.
Definition: BaseCamera.hh:761
T clamp(T _v, T _min, T _max)
math::Angle hfov
Horizontal camera field of view.
Definition: BaseCamera.hh:227
virtual unsigned int Height() const =0
Get render target height in pixels.
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: BaseCamera.hh:775
#define IGN_COMMON_WARN_IGNORE__DLL_INTERFACE_MISSING
virtual PixelFormat Format() const =0
Set the render target image format.