[Evas, Edje] Adding of new structures
authorperepelits.m <perepelits.m@samsung.com>
Thu, 8 Jan 2015 06:21:15 +0000 (15:21 +0900)
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>
Thu, 8 Jan 2015 06:21:17 +0000 (15:21 +0900)
Summary:
There will be several methods to set orientation in edc, so we have decided to make one big vector,
the main reason is that we use quaternion by default, but look_at, for example, is given as 6 coordinates.

Reviewers: Hermet, cedric, raster

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D1693

src/lib/edje/edje_private.h
src/lib/evas/Evas_Eo.h

index ab50abe..19bc694 100644 (file)
@@ -1347,8 +1347,9 @@ struct _Edje_Part_Description_Spec_Mesh_Node
    AABB     aabb2;
 
    struct {
-      Evas_Real      angle;
-      Edje_3D_Vec    axis;
+      Evas_3D_Node_Orientation_Type      type;
+      FLOAT_T                            data[6];
+      int                                look_to; /* -1 = whole part collection, or part ID */
    } orientation;
 
    struct {
@@ -1370,10 +1371,13 @@ struct _Edje_Part_Description_Spec_Light
       Edje_3D_Vec   point;
 
       unsigned char space;
-      Edje_3D_Vec   look1;
-      Edje_3D_Vec   look2;
-      int           look_to; /* -1 = whole part collection, or part ID */
    } position;
+
+   struct {
+      Evas_3D_Node_Orientation_Type      type;
+      FLOAT_T                            data[6];
+      int                                look_to; /* -1 = whole part collection, or part ID */
+   } orientation;
 };
 
 struct _Edje_Part_Description_Spec_Camera
@@ -1388,10 +1392,13 @@ struct _Edje_Part_Description_Spec_Camera
    struct {
       Edje_3D_Vec   point;
       unsigned char space;
-      Edje_3D_Vec   look1;
-      Edje_3D_Vec   look2;
-      int           look_to; /* -1 = whole part collection, or part ID */
    } position;
+
+   struct {
+      Evas_3D_Node_Orientation_Type      type;
+      FLOAT_T                            data[6];
+      int                                look_to; /* -1 = whole part collection, or part ID */
+   } orientation;
 };
 
 
index 5a493e1..088f15f 100644 (file)
@@ -539,6 +539,28 @@ typedef enum _Evas_3D_Node_Type
 } Evas_3D_Node_Type;
 
 /**
+ * Types of node orientation
+ *
+ * @since 1.13
+ * @ingroup Evas_3D_Types
+ */
+typedef enum _Evas_3D_Node_Orientation_Type
+{
+   /**< Node with no orientation properties */
+   EVAS_3D_NODE_ORIENTATION_TYPE_NONE = 0,
+   /**< Node orientation is given as a point to look at and a vector
+        that indicates the angle at which the subject is looking at the point */
+   EVAS_3D_NODE_ORIENTATION_TYPE_LOOK_AT,
+   /**< Node orientation is given as id of another part to look at and a vector
+        that indicates the angle at which the subject is looking at the part */
+   EVAS_3D_NODE_ORIENTATION_TYPE_LOOK_TO,
+   /**< Node orientation is given as an angle and an axis to rotate around */
+   EVAS_3D_NODE_ORIENTATION_TYPE_ANGLE_AXIS,
+   /**< Node orientation is given as a quaternion */
+   EVAS_3D_NODE_ORIENTATION_TYPE_QUATERNION,
+} Evas_3D_Node_Orientation_Type;
+
+/**
  * Vertex attribute IDs
  *
  * @since 1.10