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:384
virtual void SetFollowOffset(const math::Vector3d &_offset)
Set offset of camera from target node being followed. The offset will be in the frame that is specifi...
Definition: BaseCamera.hh:626
virtual void SetImageHeight(const unsigned int _height)
Set the image height in pixels.
Definition: BaseCamera.hh:235
TextureUnitState::TextureAddressingMode u
virtual bool SaveFrame(const std::string &_name)
Writes the previously rendered frame to a file. This function can be called multiple times after Post...
Definition: BaseCamera.hh:369
virtual math::Matrix4d ProjectionMatrix() const
Get the projection matrix for this camera.
Definition: BaseCamera.hh:426
virtual void SetFollowPGain(const double _pGain)
Set follow P Gain. Determines how fast the camera moves to follow the target node. Valid range: [0-1].
Definition: BaseCamera.hh:633
Definition: BaseCamera.hh:39
virtual void PostRender()
Preforms any necessary final rendering work. Once rendering is complete the camera will alert any lis...
Definition: BaseCamera.hh:328
virtual double FollowPGain() const
Get the camera follow movement P gain.
Definition: BaseCamera.hh:640
math::Vector3d trackOffset
Set camera to track a point offset in target node's local or world frame depending on trackWorldFrame...
Definition: BaseCamera.hh:180
virtual double AspectRatio() const
Get the camera's aspect ratio.
Definition: BaseCamera.hh:501
T endl(T... args)
static const IdString Pose
common::EventT< void(const void *, unsigned int, unsigned int, unsigned int, const std::string &)> newFrameEvent
Definition: BaseCamera.hh:153
virtual NodePtr FollowTarget() const
Get the target node being followed.
Definition: BaseCamera.hh:612
shared_ptr< RenderWindow > RenderWindowPtr
Definition: RenderTypes.hh:129
virtual math::Matrix4d ViewMatrix() const
Get the view matrix for this camera.
Definition: BaseCamera.hh:468
virtual void SetFormat(PixelFormat _format)=0
Set the render target image format.
virtual NodePtr TrackTarget() const
Get the target node being tracked.
Definition: BaseCamera.hh:567
virtual void PreRender()
Prepare this object and any of its children for rendering. This should be called for each object in a...
Definition: BaseCamera.hh:266
math::Vector3d followOffset
Offset distance between camera and target node being followed.
Definition: BaseCamera.hh:197
virtual void SetFarClipPlane(const double _far)
Set the camera's far clipping plane distance.
Definition: BaseCamera.hh:536
virtual void SetTrackTarget(const NodePtr &_target, const math::Vector3d &_offset, const bool _worldFrame)
Set a node for camera to track. The camera will automatically change its orientation to face the targ...
Definition: BaseCamera.hh:557
virtual RenderWindowPtr CreateRenderWindow()
Create a render window.
Definition: BaseCamera.hh:416
virtual void SetFollowTarget(const NodePtr &_target, const math::Vector3d &_Offset, const bool _worldFrame)
Set a node for camera to follow. The camera will automatically update its position to keep itself at ...
Definition: BaseCamera.hh:602
STL class.
Represents a render-target to which cameras can render images.
Definition: RenderTarget.hh:34
virtual double FarClipPlane() const
Get the camera's far clipping plane distance.
Definition: BaseCamera.hh:529
virtual unsigned int AntiAliasing() const
Get the level of anti-aliasing used during rendering.
Definition: BaseCamera.hh:515
virtual void Capture(Image &_image)
Renders a new frame and writes the results to the given image. This is a convenience function for sin...
Definition: BaseCamera.hh:354
virtual unsigned int ImageMemorySize() const
Get the total image memory size in bytes.
Definition: BaseCamera.hh:242
virtual void SetImageFormat(PixelFormat _format)
Set the image pixel format.
Definition: BaseCamera.hh:259
virtual math::Angle HFOV() const
Get the camera's horizontal field-of-view.
Definition: BaseCamera.hh:487
Encapsulates a raw image buffer and relevant properties.
Definition: Image.hh:30
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: Scene.hh:44
virtual common::ConnectionPtr ConnectNewImageFrame(Camera::NewFrameListener _listener)
Subscribes a new listener to this camera's new frame event.
Definition: BaseCamera.hh:376
virtual void SetTrackPGain(const double _pGain)
Set track P Gain. Determines how fast the camera rotates to look at the target node. Valid range: [0-1].
Definition: BaseCamera.hh:588
virtual math::Vector3d FollowOffset() const
Get the follow offset vector in the frame specified at the time the follow target is set...
Definition: BaseCamera.hh:619
virtual void SetHFOV(const math::Angle &_hfov)
Set the camera's horizontal field-of-view.
Definition: BaseCamera.hh:494
virtual RenderEngine * Engine() const =0
Get the creating render-engine of the scene.
Posable camera used for rendering the scene graph.
Definition: Camera.hh:35
virtual void SetAntiAliasing(const unsigned int _aa)
Set the level of anti-aliasing used during rendering. If a value of 0 is given, no anti-aliasing will...
Definition: BaseCamera.hh:522
virtual unsigned int ImageHeight() const
Get the image height in pixels.
Definition: BaseCamera.hh:228
NodePtr trackNode
Target node to track if camera tracking is on.
Definition: BaseCamera.hh:173
virtual void SetAspectRatio(const double _ratio)
Set the camera's aspect ratio. This value determines the cameras vertical field-of-view. It is often the.
Definition: BaseCamera.hh:508
NodePtr followNode
Target node to follow.
Definition: BaseCamera.hh:187
virtual void SetHeight(const unsigned int _height)=0
Set the render target height in pixels.
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 math::Vector3d TrackOffset() const
Get the track offset vector in the frame specified at the time the track target is set...
Definition: BaseCamera.hh:574
virtual double NearClipPlane() const
Get the camera's near clipping plane distance.
Definition: BaseCamera.hh:543
bool result
virtual double TrackPGain() const
Get the camera track rotation P gain.
Definition: BaseCamera.hh:595
virtual void Update()
Renders a new frame. This is a convenience function for single-camera scenes. It wraps the pre-render...
Definition: BaseCamera.hh:345
T tan(T... args)
virtual PixelFormat ImageFormat() const
Get the image pixel format. If the image pixel format has not been set with a valid value...
Definition: BaseCamera.hh:252
virtual void Copy(Image &_image) const =0
Write rendered image to given Image. The RenderTarget will convert the underlying image to the specif...
virtual void PreRender()=0
Prepare scene for rendering. The scene will flushing any scene changes by traversing scene-graph...
Definition: ArrowVisual.hh:22
virtual void SetImageWidth(const unsigned int _width)
Set the image width in pixels.
Definition: BaseCamera.hh:221
virtual void Copy(Image &_image) const
Writes the last rendered image to the given image buffer. This function can be called multiple times ...
Definition: BaseCamera.hh:362
virtual unsigned int Width() const =0
Get render target width in pixels.
virtual Image CreateImage() const
Created an empty image buffer for capturing images. The resulting image will have sufficient memory a...
Definition: BaseCamera.hh:335
virtual unsigned int ImageWidth() const
Get the image width in pixels.
Definition: BaseCamera.hh:214
virtual void SetTrackOffset(const math::Vector3d &_offset)
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:581
math::Angle hfov
Horizontal camera field of view.
Definition: BaseCamera.hh:167
virtual unsigned int Height() const =0
Get render target height in pixels.
virtual void SetNearClipPlane(const double _near)
Set the camera's near clipping plane distance.
Definition: BaseCamera.hh:550
virtual PixelFormat Format() const =0
Set the render target image format.