summaryrefslogtreecommitdiff
path: root/src/lib/evas/canvas/evas_3d_node.eo
blob: 19291d2994e64365d3fc30eb5bf02e311813e668 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
class Evas_3D_Node (Evas_3D_Object, Evas.Common_Interface)
{
   legacy_prefix: null;
   data: Evas_3D_Node_Data;
   methods {
      constructor {
         /*@ Constructor. */
         legacy: null;
         params {
            @in Evas_3D_Node_Type type;
         }
      }
      type_get @const {
         /*
           Get the type of the given node.

           @return     The type of the given node.

           @see evas_3d_node_add()

           @ingroup Evas_3D_Node
          */
         return: Evas_3D_Node_Type ;
      }
      member_add {
         /*
           Add a member node to the given node.

           Nodes can be constructed into N-ary tree structure like other ordinary scene
           graph. Basically a node inherit transforms from its parent.

           @see evas_3d_node_parent_get()

           @ingroup Evas_3D_Node
          */

         params {
            @in Evas_3D_Node *member;  /*@ Node object to be added. */
         }
      }
      member_del {
         /*
           Delete a member node from the given node.

           @see evas_3d_node_member_add()

           @ingroup Evas_3D_Node
          */

         params {
            @in Evas_3D_Node *member;  /*@ Member node to be deleted from the given node. */
         }
      }

      parent_get @const {
         /*
           Get the parent node of the given node.

           @return        The parent node of the given node.

           @see evas_3d_node_member_add()

           @ingroup Evas_3D_Node
          */
         return: Evas_3D_Node *;
      }

      member_list_get @const {
         /*
           Get the list of member nodes of the given node.

           @return        The list of member nodes if any or @c NULL if there are none.

           @see evas_3d_node_member_add()

           @ingroup Evas_3D_Node
          */
         return: const(list<Evas_3D_Node *>)*;
      }
      position_set {

         /*
           Set the position of the given node.

           According to the inheritance flag, (x, y, z) can be a world space position or
           parent space position.

           Default position is (0.0, 0.0, 0.0).

           @see evas_3d_node_position_inherit_set()

           @ingroup Evas_3D_Node_Transform
          */
         params {
            @in Evas_Real x;  /*@ X coordinate of the position. */
            @in Evas_Real y;  /*@ Y coordinate of the position. */
            @in Evas_Real z;  /*@ Z coordinate of the position. */
         }
      }
      orientation_set {
         /*
           Set the orientation of the given node using quaternion.

           According the the inheritance flag, (w, x, y, z) can be a world space
           orientation or parent space orientation.

           Default orientation is (1.0, 0.0, 0.0, 0.0) (identity quaternion).

           @see evas_3d_node_orientation_inherit_set()

           @ingroup Evas_3D_Node_Transform
          */
         params {
            @in Evas_Real x;  /*@ X term of the orientation quaternion (w, x, y, z) */
            @in Evas_Real y;  /*@ Y term of the orientation quaternion (w, x, y, z) */
            @in Evas_Real z;  /*@ Z term of the orientation quaternion (w, x, y, z) */
            @in Evas_Real w;  /*@ W term of the orientation quaternion (w, x, y, z) */
         }
      }

      orientation_angle_axis_set {
         /*
           Set the orientation of the given node using axis-angle.

           @param node    The given node.
           @param angle   Rotation angle.
           @param x       X term of the rotation axis.
           @param y       Y term of the rotation axis.
           @param z       Z term of the rotation axis.

           @see evas_3d_node_orientation_set()

           @ingroup Evas_3D_Node_Transform
          */
         params {
            @in Evas_Real angle;  /*@ Rotation angle.*/
            @in Evas_Real x;      /*@ X term of the rotation axis.*/
            @in Evas_Real y;      /*@ Y term of the rotation axis.*/
            @in Evas_Real z;      /*@ Z term of the rotation axis.*/
         }
      }

      scale_set {
         /*
           Set the scale of the given node.

           @param node    The given node.
           @param x       Scale factor along X-axis.
           @param y       Scale factor along Y-axis.
           @param z       Scale factor along Z-axis.

           According to the inheritance flag, (x, y, z) can be a world space scale or
           parent space scale. Be careful when using non-uniform scale factor with
           inheritance, each transform attributes are not affected by other attributes.

           Default scale is (1.0, 1.0, 1.0).

           @see evas_3d_node_scale_inherit_set()

           @ingroup Evas_3D_Node_Transform
          */
         params {
            @in Evas_Real x;      /*@ Scale factor along X-axis.*/
            @in Evas_Real y;      /*@ Scale factor along Y-axis.*/
            @in Evas_Real z;      /*@ Scale factor along Z-axis.*/
         }
      }

      position_get @const {
         /*
           Get the position of the given node.

           @param node    The given node.
           @param x       Pointer to receive X coordinate of the position.
           @param y       Pointer to receive Y coordinate of the position.
           @param z       Pointer to receive Z coordinate of the position.

           @see evas_3d_node_position_set()

           @ingroup Evas_3D_Node_Transform
          */
         params {
            @in Evas_3D_Space space; /*@  */
            @out Evas_Real x;      /*@ Pointer to receive X coordinate of the position.*/
            @out Evas_Real y;      /*@ Pointer to receive Y coordinate of the position.*/
            @out Evas_Real z;      /*@ Pointer to receive Z coordinate of the position.*/
         }
      }

      orientation_get @const {
         /*
           Get the orientation of the given node as quaternion.

           @param node    The given node.
           @param x       Pointer to receive X term of the orientation quaternion.
           @param y       Pointer to receive Y term of the orientation quaternion.
           @param z       Pointer to receive Z term of the orientation quaternion.
           @param w       Pointer to receive W term of the orientation quaternion.

           @see evas_3d_node_orientation_set()

           @ingroup Evas_3D_Node_Transform
          */
         params {
            @in Evas_3D_Space space; /*@  */
            @out Evas_Real x;      /*@ Pointer to receive X term of the orientation quaternion.*/
            @out Evas_Real y;      /*@ Pointer to receive Y term of the orientation quaternion.*/
            @out Evas_Real z;      /*@ Pointer to receive Z term of the orientation quaternion.*/
            @out Evas_Real w;      /*@ Pointer to receive W term of the orientation quaternion.*/
         }
      }

      scale_get @const {
         /*
           Get the scale of the given node.

           @param node    The given node.
           @param x       Pointer to receive Scale factor along X-axis.
           @param y       Pointer to receive Scale factor along Y-axis.
           @param z       Pointer to receive Scale factor along Z-axis.

           @see evas_3d_node_scale_get()

           @ingroup Evas_3D_Node_Transform
          */
         params {
            @in Evas_3D_Space space; /*@  */
            @out Evas_Real x;      /*@ Pointer to receive Scale factor along X-axis.*/
            @out Evas_Real y;      /*@ Pointer to receive Scale factor along X-axis.*/
            @out Evas_Real z;      /*@ Pointer to receive Scale factor along X-axis.*/
         }
      }

      look_at_set {
         /*
           Rotate the given node to look at desired position.

           @param node          The given node.
           @param target_space  Space where the target position belongs to.
           @param x             X coordinate of the target position.
           @param y             Y coordinate of the target position.
           @param z             Z coordinate of the target position.
           @param up_space      Space where the up vector belongs to.
           @param ux            X term of the up vector.
           @param uy            Y term of the up vector.
           @param uz            Z term of the up vector.

           This function rotate the given node so that its forward vector (negative
           Z-axis) points to the desired position and the up vector coincide with the
           given up vector.

           @see evas_3d_node_orientation_set()

           @ingroup Evas_3D_Node_Transform
          */

         params {
            @in Evas_3D_Space target_space;  /*@ Space where the target position belongs to. */
            @in Evas_Real x;                 /*@ X coordinate of the target position. */
            @in Evas_Real y;                 /*@ Y coordinate of the target position. */
            @in Evas_Real z;                 /*@ Z coordinate of the target position. */
            @in Evas_3D_Space up_space;      /*@ Space where the up vector belongs to. */
            @in Evas_Real ux;                /*@ X term of the up vector. */
            @in Evas_Real uy;                /*@ Y term of the up vector. */
            @in Evas_Real uz;                /*@ Z term of the up vector. */
         }
      }

      mesh_add {
         /*
           Add a mesh to the given node.

           @param node          The given node.
           @param mesh          The mesh to be added.

           If the node is not of type EVAS_3D_NODE_TYPE_MESH, error message will be
           generated and nothing happens.

           @see evas_3d_node_add()

           @ingroup Evas_3D_Node
          */
         params {
            @in Evas_3D_Mesh *mesh;      /*@ The mesh to be added.*/
         }
      }

      mesh_del {
         /*
           Delete a mesh from the given node.

           @param node          The given node.
           @param mesh          The mesh to be deleted.

           If the node is not of type EVAS_3D_NODE_TYPE_MESH or the given mesh does not
           belong to the given node, error message will be gnerated and nothing happens.

           @see evas_3d_node_mesh_add()

           @ingroup Evas_3D_Node
          */
         params {
            @in Evas_3D_Mesh *mesh;      /*@ The mesh to be deleted.*/
         }
      }

      mesh_list_get @const {
         /*
           Get the list of meshes of the given node.

           @param node          The given node.
           @return              The list of meshes if any, or @c NULL if there're none.

           If the node is not of type EVAS_3D_NODE_TYPE_MESH, error message will be
           generated and @c NULL will be returned. If there're no meshes in the given
           node, @c NULL will be returned.

           @see evas_3d_node_mesh_add()

           @ingroup Evas_3D_Node
          */
         return: const(list<Evas_3D_Mesh *>)*;
      }

      bounding_box_get{
         /*
           Get axis-aligned bounding box (AABB) of the given node.
          *
          * @param node     The given node.
          * @param x        Pointer to receive X coordinate of the first point of AABB.
          * @param y        Pointer to receive Y coordinate of the first point of AABB.
          * @param z        Pointer to receive Z coordinate of the first point of AABB.
          * @param x2       Pointer to receive X coordinate of the second point of AABB.
          * @param y2       Pointer to receive Y coordinate of the second point of AABB.
          * @param z2       Pointer to receive Z coordinate of the second point of AABB.

           @ingroup Evas_3D_Node
          */
         params {
            @in Evas_Real *x;      /*@ Coordinates of vector.*/
            @in Evas_Real *y;
            @in Evas_Real *z;
            @in Evas_Real *x2;
            @in Evas_Real *y2;
            @in Evas_Real *z2;
         }
      }

      bounding_sphere_get {
         /*
          Get bounding sphere of the given node.
          *
          * @param node     The given node.

          * @param x       Pointer to receive X coordinate of the center of sphere.
          * @param y       Pointer to receive Y coordinate of the center of sphere.
          * @param z       Pointer to receive Z coordinate of center of sphere.
          * @param r       Pointer to receive radius of center of sphere.

           @ingroup Evas_3D_Node
          */
         params {

            @in Evas_Real *x;      /*@ Coordinates of vector.*/
            @in Evas_Real *y;
            @in Evas_Real *z;
            @in Evas_Real *r;
         }
      }

      @property position_inherit {
         set {
            /*
              Set the position inheritance flag of the given node.

              @param node    The given node.
              @param inherit Whether to inherit parent position @c EINA_TRUE or not @c EINA_FALSE.

              When inheritance is enabled, a node's world space position is determined by
              adding the parent node's world position and the node's position, otherwise,
              the node's position will be the world space position.

              @ingroup Evas_3D_Node_Transform
             */
         }
         get {
            /*
              Get the position inheritance flag of the given node.

              @param node    The given node.
              @return        @c EINA_TRUE if inheritance is enabled, or @c EINA_FALSE if not.

              @see evas_3d_node_position_inherit_set()

              @ingroup Evas_3D_Node_Transform
             */
         }
         values {
            bool inherit; /*@ Whether to inherit parent position*/
         }
      }

      @property orientation_inherit {
         set {
            /*
              Set the orientation inheritance flag of the given node.

              @param node    The given node.
              @param inherit Whether to inherit parent orientation @c EINA_TRUE or not @c EINA_FALSE.

              When inheritance is enabled, a node's world space orientation is determined
              by multiplying the parent node's world orientation and the node's
              orientation, otherwise, the node's orientation will be the world space
              orientation.

              @ingroup Evas_3D_Node_Transform
            */
         }
         get {
            /*
              Get the orientation inheritance flag of the given node.

              @param node    The given node.
              @return        @c EINA_TRUE if inheritance is enabled, or @c EINA_FALSE if not.

              @see evas_3d_node_orientation_inherit_set()

              @ingroup Evas_3D_Node_Transform
             */
         }
         values {
            bool inherit; /*@ Whether to inherit parent orientation*/
         }
      }

      @property scale_inherit {
         set {
            /*
              Set the scale inheritance flag of the given node.

              @param node    The given node.
              @param inherit Whether to inherit parent scale @c EINA_TRUE or not @c EINA_FALSE.

              When inheritance is enabled, a node's world space scale is determined by
              multiplying the parent node's world scale and the node's scale, otherwise,
              the node's scale will be the world space scale.

              @ingroup Evas_3D_Node_Transform
             */
         }
         get {
            /*
              Get the scale inheritance flag of the given node.

              @param node    The given node.
              @return        @c EINA_TRUE if inheritance is enabled, or @c EINA_FALSE if not.

              @see evas_3d_node_scale_inherit_set()

              @ingroup Evas_3D_Node_Transform
             */
         }
         values {
            bool inherit; /*@ Whether to inherit parent scale*/
         }
      }

      @property camera {
         set {
            /*
              Set a camera to the given node.

              @param node          The given node.
              @param camera        The camera to be set.

              If the node is not of type EVAS_3D_NODE_TYPE_CAMERA, error message will be
              generated and nothing happens.

              @see evas_3d_node_add()

              @ingroup Evas_3D_Node
             */
         }
         get {
            /*
              Get the camera of the given node.

              @param node          The given node.
              @return              The camera of the given node if any, or @c NULL if there're none.

              @see evas_3d_node_camera_set()

              @ingroup Evas_3D_Node
             */
         }
         values {
            Evas_3D_Camera *camera; /*@ The camera */
         }
      }

      @property light {
         set {
            /*
              Set the light of the given node.

              @param node          The given node.
              @param light         The light to be set.

              If the node is not of type EVAS_3D_NODE_TYPE_LIGHT, error message will be
              generated and nothing happens.

              @see evas_3d_node_add()

              @ingroup Evas_3D_Node
             */
         }
         get {
            /*
              Get the light of the given node.

              @param node          The given node.
              @return              The light of the given node if any, or @c NULL if there're none.

              @see evas_3d_node_light_set()

              @ingroup Evas_3D_Node
             */
         }
         values {
            Evas_3D_Light *light; /*@ The light */
         }
      }

      @property mesh_frame {
         set {
            /*
              Set the animation frame number of the given node for the given mesh.

              @param node          The given node.
              @param mesh          The given mesh.
              @param frame         The animation frame number.

              If the node is not of type EVAS_3D_NODE_TYPE_MESH or the given mesh does not
              belong to the given mesh error mesh will be generated and nothing happens.

              Default mesh frame is 0.

              @see evas_3d_node_mesh_add()

              @ingroup Evas_3D_Node
             */
         }
         get {
            /*
              Set the animation frame number of the given node for the given mesh.

              @param node          The given node.
              @param mesh          The given mesh.
              @param frame         The animation frame number.

              If the node is not of type EVAS_3D_NODE_TYPE_MESH or the given mesh does not
              belong to the given mesh error mesh will be generated and nothing happens.

              @see evas_3d_node_mesh_add()

              @ingroup Evas_3D_Node
             */
         }
         keys {
            Evas_3D_Mesh *mesh; /*@ The given mesh.*/
         }
         values {
            int frame; /*@ The animation frame number.*/
         }
      }

      @property billboard_target {
         set {
            /*
              Set behavior of node like billboard object.

              @param node          The given node.
              @param billboard     Pointer to target node for given node.

              @ingroup Evas_3D_Node
             */
         }
         get {
            /*
              Get the target node for billboard object.

              @param node          The given node.
              @return              The pointer to target node for billboard object,
                                   or @c NULL if there're none.

              @see evas_3d_node_billboard_set()

              @ingroup Evas_3D_Node
             */
         }
         values {
            Eo *target;      /*@ Target node.*/
         }
      }
   }
   implements {
      Eo.Base.destructor;
      Evas_3D_Object.update_notify;
      Evas_3D_Object.change_notify;
      Evas_3D_Object.callback_register;
      Evas_3D_Object.callback_unregister;
   }
   constructors {
      .constructor;
   }
}