Merge "Alignment - Fix a pixel alignment issue with the center alignment." into new_text
[platform/core/uifw/dali-toolkit.git] / plugins / dali-script-v8 / docs / content / camera-actor.js
1 /**
2  ## Camera Actor API ( extends Actor API)
3
4
5 Allows the developer to use actor semantics to control a camera.
6
7 There are two types of camera actor, FREE_LOOK and LOOK_AT_TARGET. By default
8 the camera actor will be FREE_LOOK.
9
10 A FREE_LOOK camera uses actor's orientation to control where the camera is looking.
11 If no additional rotations are specified, the camera looks in the negative Z direction.
12
13 For LOOK_AT_TARGET the actor's orientation is ignored, instead the camera looks at TARGET_POSITION
14 in world coordinates.
15 ```
16 // get the camera currently used
17 var defaultCamera = dali.stage.getRenderTaskList().getTask(0).getCameraActor();
18   
19 var fov = defaultCamera.fieldOfView;
20   
21 // increase field of view by 10%
22 defaultCamera.fieldOfView = fov * 1.1;
23   
24 // shift the camera to the left, the rendered scene will shift to the right
25 defaultCamera.x -= 10;
26 ```
27   
28 ### Camera Actor Specific Properties
29
30 | Name                   |    Type    | Writable     | Animatable|
31 |------------------------|------------|--------------|-----------|
32 | type                  |  dali.CAMERA_FREE_LOOK or  dali.CAMERA_LOOK_AT_TARGET  | ✔ | ✘ |
33 | projectionMode        | dali.CAMERA_ORTHOGRAPHIC_PROJECTION or dali.CAMERA_PERSPECTIVE_PROJECTION  | ✔| ✘ |
34 | fieldOfView           | FLOAT      | ✔ | ✘  |
35 | aspectRatio           | FLOAT      | ✔ | ✘  |
36 | nearPlaneDistance     | FLOAT      | ✔ | ✘  |
37 | farPlaneDistance      | FLOAT      | ✔ | ✘  |
38 | leftPlaneDistance     | FLOAT      | ✔ | ✘  |
39 | rightPlaneDistance    | FLOAT      | ✔ | ✘  |
40 | topPlaneDistance      | FLOAT      | ✔ | ✘  |
41 | bottomPlaneDistance   | FLOAT      | ✔ | ✘  |
42 | targetPosition        | VECTOR3    | ✔ | ✘  |
43 | projectionMatrix      | MATRIX     | ✔ | ✘  |
44 | viewMatrix            | MATRIX     | ✔ | ✘  |
45 | invertYAxis           | BOOLEAN    | ✔ | ✘  |
46
47
48
49   @class CameraActor
50   @extends Actor
51  */