Tizen Native API
5.5
|
CameraActor controls a camera. More...
Classes | |
struct | Property |
Enumeration for the instance of properties belonging to the CameraActor class. More... | |
Public Member Functions | |
CameraActor () | |
Creates an uninitialized CameraActor handle. | |
~CameraActor () | |
Destructor. | |
CameraActor (const CameraActor ©) | |
Copy constructor. | |
CameraActor & | operator= (const CameraActor &rhs) |
Assignment operator. | |
void | SetType (Dali::Camera::Type type) |
Sets the camera type. The default type is Dali::Camera::FREE_LOOK. | |
Dali::Camera::Type | GetType () const |
Gets the type of the camera. | |
void | SetProjectionMode (Dali::Camera::ProjectionMode mode) |
Sets the projection mode. | |
Dali::Camera::ProjectionMode | GetProjectionMode () const |
Gets the projection mode. | |
void | SetFieldOfView (float fieldOfView) |
Sets the field of view. | |
float | GetFieldOfView () |
Gets the field of view in Radians. | |
void | SetAspectRatio (float aspectRatio) |
Sets the aspect ratio. | |
float | GetAspectRatio () |
Gets the aspect ratio of the camera. | |
void | SetNearClippingPlane (float nearClippingPlane) |
Sets the near clipping plane distance. | |
float | GetNearClippingPlane () |
Gets the near clipping plane distance. | |
void | SetFarClippingPlane (float farClippingPlane) |
Sets the far clipping plane distance. | |
float | GetFarClippingPlane () |
Gets the far clipping plane distance. | |
void | SetTargetPosition (const Vector3 &targetPosition) |
Sets the target position of the camera. | |
Vector3 | GetTargetPosition () const |
Gets the Camera Target position. | |
void | SetInvertYAxis (bool invertYAxis) |
Requests for an inversion on the Y axis on the projection calculation. | |
bool | GetInvertYAxis () |
Gets whether the Y axis is inverted. | |
void | SetPerspectiveProjection (const Size &size) |
Sets the default camera perspective projection for the given canvas size. | |
void | SetOrthographicProjection (const Size &size) |
Sets the camera projection to use orthographic projection. | |
void | SetOrthographicProjection (float left, float right, float top, float bottom, float near, float far) |
Sets the camera projection to use orthographic projection with the given clip planes. | |
Static Public Member Functions | |
static CameraActor | New () |
Creates a CameraActor object. | |
static CameraActor | New (const Size &size) |
Creates a CameraActor object. | |
static CameraActor | DownCast (BaseHandle handle) |
Downcasts a handle to CameraActor handle. |
CameraActor controls a camera.
Allows the developer to use actor semantics to control a camera.
DALi has a concept of a camera to display its virtual 3D world to a 2D screen. There are 2 ways of using the camera in DALi:
There are two types of camera actor, FREE_LOOK and LOOK_AT_TARGET. By default, the camera actor will be FREE_LOOK.
Creates an uninitialized CameraActor handle.
Initialize it using CameraActor::New(). Calling member functions with an uninitialized CameraActor handle is not allowed.
Destructor.
This is non-virtual, since derived Handle types must not contain data or virtual methods.
Dali::CameraActor::CameraActor | ( | const CameraActor & | copy | ) |
Copy constructor.
[in] | copy | The actor to copy |
static CameraActor Dali::CameraActor::DownCast | ( | BaseHandle | handle | ) | [static] |
Downcasts a handle to CameraActor handle.
If handle points to a CameraActor, the downcast produces valid handle. If not, the returned handle is left uninitialized.
[in] | handle | to An object |
Reimplemented from Dali::Actor.
float Dali::CameraActor::GetAspectRatio | ( | ) |
Gets the aspect ratio of the camera.
The default aspect ratio is 4.0f/3.0f.
float Dali::CameraActor::GetFarClippingPlane | ( | ) |
Gets the far clipping plane distance.
The default value is the default near clipping plane + (0xFFFF>>4).
float Dali::CameraActor::GetFieldOfView | ( | ) |
Gets the field of view in Radians.
The default field of view is 45 degrees.
bool Dali::CameraActor::GetInvertYAxis | ( | ) |
Gets whether the Y axis is inverted.
True
if the Y axis is inverted, false
otherwise float Dali::CameraActor::GetNearClippingPlane | ( | ) |
Gets the near clipping plane distance.
The default near clipping plane is 800.0f, to match the default screen height. Reduce this value to see objects closer to the camera.
Gets the projection mode.
Vector3 Dali::CameraActor::GetTargetPosition | ( | ) | const |
Gets the Camera Target position.
The default target position is Vector3::ZERO.
Dali::Camera::Type Dali::CameraActor::GetType | ( | ) | const |
Gets the type of the camera.
static CameraActor Dali::CameraActor::New | ( | ) | [static] |
Creates a CameraActor object.
Reimplemented from Dali::Actor.
static CameraActor Dali::CameraActor::New | ( | const Size & | size | ) | [static] |
Creates a CameraActor object.
Sets the default camera perspective projection for the given canvas size.
[in] | size | The canvas size |
CameraActor& Dali::CameraActor::operator= | ( | const CameraActor & | rhs | ) |
Assignment operator.
[in] | rhs | The actor to copy |
void Dali::CameraActor::SetAspectRatio | ( | float | aspectRatio | ) |
Sets the aspect ratio.
[in] | aspectRatio | The aspect ratio |
void Dali::CameraActor::SetFarClippingPlane | ( | float | farClippingPlane | ) |
Sets the far clipping plane distance.
[in] | farClippingPlane | Distance of the far clipping plane |
void Dali::CameraActor::SetFieldOfView | ( | float | fieldOfView | ) |
Sets the field of view.
[in] | fieldOfView | The field of view in radians |
void Dali::CameraActor::SetInvertYAxis | ( | bool | invertYAxis | ) |
Requests for an inversion on the Y axis on the projection calculation.
The default value is not inverted.
[in] | invertYAxis | True if the Y axis should be inverted |
void Dali::CameraActor::SetNearClippingPlane | ( | float | nearClippingPlane | ) |
Sets the near clipping plane distance.
[in] | nearClippingPlane | Distance of the near clipping plane |
void Dali::CameraActor::SetOrthographicProjection | ( | const Size & | size | ) |
Sets the camera projection to use orthographic projection.
The XY plane is centered on the camera axis. The units in the X/Y plane directly equate to pixels on an equivalently sized framebuffer.
The Z position of the actor, and the near and far clip planes of the bounding box match those that would be created by using SetPerspectiveProjection with the same size.
[in] | size | Size of XY plane (normal to camera axis) |
void Dali::CameraActor::SetOrthographicProjection | ( | float | left, |
float | right, | ||
float | top, | ||
float | bottom, | ||
float | near, | ||
float | far | ||
) |
Sets the camera projection to use orthographic projection with the given clip planes.
This does not change the Z value of the camera actor.
[in] | left | Distance to left clip plane (normal to camera axis) |
[in] | right | Distance to right clip plane (normal to camera axis) |
[in] | top | Distance to top clip plane (normal to camera axis) |
[in] | bottom | Distance to bottom clip plane (normal to camera axis) |
[in] | near | Distance to the near clip plane (along camera axis) |
[in] | far | Distance to the far clip plane (along camera axis) |
void Dali::CameraActor::SetPerspectiveProjection | ( | const Size & | size | ) |
Sets the default camera perspective projection for the given canvas size.
Sets the near and far clipping planes, the field of view, the aspect ratio, and the Z position of the actor based on the canvas size so that 1 unit in XY (z=0) plane is 1 pixel on screen.
[in] | size | The canvas size |
Sets the projection mode.
[in] | mode | One of PERSPECTIVE_PROJECTION or ORTHOGRAPHIC_PROJECTION |
void Dali::CameraActor::SetTargetPosition | ( | const Vector3 & | targetPosition | ) |
Sets the target position of the camera.
[in] | targetPosition | The position of the target to look at |
void Dali::CameraActor::SetType | ( | Dali::Camera::Type | type | ) |
Sets the camera type. The default type is Dali::Camera::FREE_LOOK.
[in] | type | The camera type |