RAMSES Documentation  27.0.130
Information for RAMSES users and developers
Camera.h
Go to the documentation of this file.
1 // -------------------------------------------------------------------------
2 // Copyright (C) 2014 BMW Car IT GmbH
3 // -------------------------------------------------------------------------
4 // This Source Code Form is subject to the terms of the Mozilla Public
5 // License, v. 2.0. If a copy of the MPL was not distributed with this
6 // file, You can obtain one at https://mozilla.org/MPL/2.0/.
7 // -------------------------------------------------------------------------
8 
9 #ifndef RAMSES_CAMERA_H
10 #define RAMSES_CAMERA_H
11 
12 #include "ramses-client-api/Node.h"
13 
14 namespace ramses
15 {
16  class DataVector2i;
17  class DataVector2f;
18  class DataVector4f;
19 
25  class RAMSES_API Camera : public Node
26  {
27  public:
53  status_t setFrustum(float leftPlane, float rightPlane, float bottomPlane, float topPlane, float nearPlane, float farPlane);
54 
75  status_t setViewport(int32_t x, int32_t y, uint32_t width, uint32_t height);
76 
84  int32_t getViewportX() const;
85 
93  int32_t getViewportY() const;
94 
102  uint32_t getViewportWidth() const;
103 
111  uint32_t getViewportHeight() const;
112 
120  float getLeftPlane() const;
121 
129  float getRightPlane() const;
130 
138  float getBottomPlane() const;
139 
147  float getTopPlane() const;
148 
156  float getNearPlane() const;
157 
165  float getFarPlane() const;
166 
176  status_t getProjectionMatrix(float (&projectionMatrix)[16]) const;
177 
191 
205 
224  status_t bindFrustumPlanes(const DataVector4f& frustumPlanesData, const DataVector2f& nearFarPlanesData);
225 
233 
241 
249 
254  bool isViewportOffsetBound() const;
255 
260  bool isViewportSizeBound() const;
261 
266  bool isFrustumPlanesBound() const;
267 
271  class CameraNodeImpl& impl;
272 
273  protected:
277  friend class SceneImpl;
278 
284  explicit Camera(CameraNodeImpl& pimpl);
285 
287  virtual ~Camera();
288  };
289 }
290 
291 #endif
#define RAMSES_API
Definition: APIExport.h:35
The Camera base class is part of a scene and defines a view into the scene defined by the client appl...
Definition: Camera.h:26
status_t bindViewportOffset(const DataVector2i &offsetData)
Binds a ramses::DataObject to be used as source for viewport offset values.
int32_t getViewportY() const
Returns the vertical offset of the viewport in pixels relative to lower left corner of destination re...
status_t unbindViewportOffset()
Unbinds any bound ramses::DataObject from viewport offset (see bindViewportOffset)....
bool isFrustumPlanesBound() const
Checks if there is a ramses::DataObject bound to viewport size (see bindFrustumPlanes).
float getRightPlane() const
Returns the right plane of the camera frustum.
int32_t getViewportX() const
Returns the horizontal offset of the viewport in pixels relative to lower left corner of destination ...
bool isViewportSizeBound() const
Checks if there is a ramses::DataObject bound to viewport size (see bindViewportSize).
float getLeftPlane() const
Returns the left plane of the camera frustum.
uint32_t getViewportWidth() const
Returns the viewport width in pixels.
bool isViewportOffsetBound() const
Checks if there is a ramses::DataObject bound to viewport offset (see bindViewportOffset).
Camera(CameraNodeImpl &pimpl)
Constructor for Camera.
float getFarPlane() const
Returns the far plane of the camera frustum.
status_t unbindViewportSize()
Unbinds any bound ramses::DataObject from viewport size (see bindViewportSize). Does nothing if no ra...
float getNearPlane() const
Returns the near plane of the camera frustum.
float getBottomPlane() const
Returns the bottom plane of the camera frustum.
status_t setViewport(int32_t x, int32_t y, uint32_t width, uint32_t height)
Sets the viewport to be used when rendering with this camera.
uint32_t getViewportHeight() const
Returns the viewport height in pixels.
status_t bindViewportSize(const DataVector2i &sizeData)
Binds a ramses::DataObject to be used as source for viewport size values.
status_t getProjectionMatrix(float(&projectionMatrix)[16]) const
Gets projection matrix based on camera parameters. Projection matrix can only be retrieved after all ...
status_t setFrustum(float leftPlane, float rightPlane, float bottomPlane, float topPlane, float nearPlane, float farPlane)
Sets camera frustum planes of the Camera.
status_t bindFrustumPlanes(const DataVector4f &frustumPlanesData, const DataVector2f &nearFarPlanesData)
Binds ramses::DataObject to be used as source for frustum planes values.
status_t unbindFrustumPlanes()
Unbinds any bound ramses::DataObject from frustum planes (see bindFrustumPlanes). Does nothing if no ...
class CameraNodeImpl & impl
Definition: Camera.h:271
float getTopPlane() const
Returns the top plane of the camera frustum.
virtual ~Camera()
The DataVector2f data object stores a vector with 2 float components within a scene.
Definition: DataVector2f.h:22
The DataVector2i data object stores a vector with two 32-bit-integer components within a scene.
Definition: DataVector2i.h:22
The DataVector4f data object stores a vector with 4 float components within a scene.
Definition: DataVector4f.h:22
The Node is the base class of all nodes and provides scene graph functionality which propagates to it...
Definition: Node.h:23
The RAMSES namespace contains all client side objects and functions used to implement RAMSES applicat...
Definition: AnimatedProperty.h:15
uint32_t status_t
Status is a handle to the result of an API call.
Definition: RamsesFrameworkTypes.h:26