Tizen Native API

Controls a camera. More...

Inheritance diagram for Dali::CameraActor:
Dali::Actor Dali::Handle Dali::BaseHandle

Classes

struct  Property
 An enumeration of properties belonging to the CameraActor class. More...

Public Member Functions

 CameraActor ()
 Create an uninitialized CameraActor handle.
 ~CameraActor ()
 Destructor.
 CameraActor (const CameraActor &copy)
 Copy constructor.
CameraActoroperator= (const CameraActor &rhs)
 Assignment operator.
void SetType (Dali::Camera::Type type)
 Set the camera type. The default type is Dali::Camera::FREE_LOOK.
Dali::Camera::Type GetType () const
 Get the type of the camera.
void SetProjectionMode (Dali::Camera::ProjectionMode mode)
 Set the projection mode.
Dali::Camera::ProjectionMode GetProjectionMode () const
 Get the projection mode.
void SetFieldOfView (float fieldOfView)
 Set the field of view.
float GetFieldOfView ()
 Get the field of view in Radians.
void SetAspectRatio (float aspectRatio)
 Set the aspect ratio.
float GetAspectRatio ()
 Get the aspect ratio of the camera.
void SetNearClippingPlane (float nearClippingPlane)
 Sets the near clipping plane distance.
float GetNearClippingPlane ()
 Get the near clipping plane distance.
void SetFarClippingPlane (float farClippingPlane)
 Sets the far clipping plane distance.
float GetFarClippingPlane ()
 Get the far clipping plane distance.
void SetTargetPosition (const Vector3 &targetPosition)
 Set the target position of the camera.
Vector3 GetTargetPosition () const
 Get Camera Target position.
void SetInvertYAxis (bool invertYAxis)
 Request for an inversion on the Y axis on the projection calculation.
bool GetInvertYAxis ()
 Get 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 ()
 Create a CameraActor object.
static CameraActor New (const Size &size)
 Create a CameraActor object.
static CameraActor DownCast (BaseHandle handle)
 Downcast a handle to CameraActor handle.

Detailed Description

Controls a camera.

Allows the developer to use actor semantics to control a camera.

There are two types of camera actor, FREE_LOOK and LOOK_AT_TARGET. By default the camera actor will be FREE_LOOK.

A FREE_LOOK camera uses actor's orientation to control where the camera is looking. If no additional rotations are specified, the camera looks in the negative Z direction.

For LOOK_AT_TARGET the actor's orientation is ignored, instead the camera looks at TARGET_POSITION in world coordinates.

Since :
2.4

Constructor & Destructor Documentation

Create an uninitialized CameraActor handle.

Initialise it using CameraActor::New(). Calling member functions with an uninitialized CameraActor handle is not allowed.

Since :
2.4

Destructor.

This is non-virtual since derived Handle types must not contain data or virtual methods.

Since :
2.4

Copy constructor.

Since :
2.4
Parameters:
[in]copyThe actor to copy.

Member Function Documentation

static CameraActor Dali::CameraActor::DownCast ( BaseHandle  handle) [static]

Downcast a handle to CameraActor handle.

If handle points to a CameraActor the downcast produces valid handle. If not the returned handle is left uninitialized.

Since :
2.4
Parameters:
[in]handleto An object
Returns:
Handle to a CameraActor or an uninitialized handle

Reimplemented from Dali::Actor.

Get the aspect ratio of the camera.

The default aspect ratio is 4.0f/3.0f.

Since :
2.4
Returns:
The aspect ratio

Get the far clipping plane distance.

The default value is the default near clipping plane + (0xFFFF>>4).

Since :
2.4
Returns:
The far clipping plane value

Get the field of view in Radians.

The default field of view is 45 degrees.

Since :
2.4
Returns:
The field of view in radians

Get whether the Y axis is inverted.

Since :
2.4
Returns:
True if the Y axis is inverted, false otherwise

Get 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.

Since :
2.4
Returns:
The near clipping plane value

Get the projection mode.

Since :
2.4
Returns:
One of PERSPECTIVE_PROJECTION or ORTHOGRAPHIC_PROJECTION

Get Camera Target position.

The default target position is Vector3::ZERO.

Since :
2.4
Returns:
The target position of the camera
Precondition:
Camera type is LOOK_AT_TARGET.

Get the type of the camera.

Since :
2.4
Returns:
The type of camera
static CameraActor Dali::CameraActor::New ( ) [static]

Create a CameraActor object.

Sets the default camera perspective projection for the stage's size.

See also:
SetPerspectiveProjection().
Since :
2.4
Returns:
The newly created camera actor.

Reimplemented from Dali::Actor.

static CameraActor Dali::CameraActor::New ( const Size size) [static]

Create a CameraActor object.

Sets the default camera perspective projection for the given canvas size.

See also:
SetPerspectiveProjection().
Since :
2.4
Parameters:
[in]sizeThe canvas size.
Returns:
The newly created camera actor.
CameraActor& Dali::CameraActor::operator= ( const CameraActor rhs)

Assignment operator.

Since :
2.4
Parameters:
[in]rhsThe actor to copy.
Returns:
A reference to this
void Dali::CameraActor::SetAspectRatio ( float  aspectRatio)

Set the aspect ratio.

Since :
2.4
Parameters:
[in]aspectRatioThe aspect ratio
void Dali::CameraActor::SetFarClippingPlane ( float  farClippingPlane)

Sets the far clipping plane distance.

Since :
2.4
Parameters:
[in]farClippingPlaneDistance of the far clipping plane
void Dali::CameraActor::SetFieldOfView ( float  fieldOfView)

Set the field of view.

Since :
2.4
Parameters:
[in]fieldOfViewThe field of view in radians
void Dali::CameraActor::SetInvertYAxis ( bool  invertYAxis)

Request for an inversion on the Y axis on the projection calculation.

The default value is not inverted.

Since :
2.4
Parameters:
[in]invertYAxisTrue if the Y axis should be inverted
void Dali::CameraActor::SetNearClippingPlane ( float  nearClippingPlane)

Sets the near clipping plane distance.

Since :
2.4
Parameters:
[in]nearClippingPlaneDistance of the near clipping plane

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.

Since :
2.4
Parameters:
[in]sizeSize 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.

Since :
2.4
Parameters:
[in]leftDistance to left clip plane (normal to camera axis)
[in]rightDistance to right clip plane (normal to camera axis)
[in]topDistance to top clip plane (normal to camera axis)
[in]bottomDistance to bottom clip plane (normal to camera axis)
[in]nearDistance to the near clip plane (along camera axis)
[in]farDistance to the far clip plane (along camera axis)

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.

If the canvas size is ZERO, it sets the default camera perspective projection for the stage's size.

Since :
2.4
Parameters:
[in]sizeThe canvas size.
Precondition:
If size is non ZERO, width and height must be greater than zero.

Set the projection mode.

Since :
2.4
Parameters:
[in]modeOne of PERSPECTIVE_PROJECTION or ORTHOGRAPHIC_PROJECTION
void Dali::CameraActor::SetTargetPosition ( const Vector3 targetPosition)

Set the target position of the camera.

Since :
2.4
Parameters:
[in]targetPositionThe position of the target to look at
Precondition:
Camera type is LOOK_AT_TARGET.

Set the camera type. The default type is Dali::Camera::FREE_LOOK.

Since :
2.4
Parameters:
[in]typeThe camera type