summaryrefslogtreecommitdiff
path: root/src/bin/edje
diff options
context:
space:
mode:
authorperepelits.m <perepelits.m@samsung.com>2015-03-06 16:31:53 +0100
committerCedric BAIL <cedric@osg.samsung.com>2015-03-06 20:19:21 +0100
commit61ea719eba9b3cb4d4cbfa8e935182af7427a855 (patch)
treeaa6416522a0b96a3f5528673d9f025b6f05eaae9 /src/bin/edje
parent9b1cdff941a429f13698184e02b37b2ad41fcaf4 (diff)
edje: add orientation properties in edje_cc
Summary: Adding of two modes of node orientation, by setting of the angle and by setting of the quaternion. Reviewers: Hermet, raster, cedric Reviewed By: cedric Subscribers: artem.popov, cedric Differential Revision: https://phab.enlightenment.org/D2087 Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Diffstat (limited to 'src/bin/edje')
-rw-r--r--src/bin/edje/edje_cc_handlers.c100
1 files changed, 100 insertions, 0 deletions
diff --git a/src/bin/edje/edje_cc_handlers.c b/src/bin/edje/edje_cc_handlers.c
index d9ce1d7f48..6d96fd27fe 100644
--- a/src/bin/edje/edje_cc_handlers.c
+++ b/src/bin/edje/edje_cc_handlers.c
@@ -376,6 +376,8 @@ static void st_collections_group_parts_part_description_properties_shade(void);
376static void st_collections_group_parts_part_description_orientation_look1(void); 376static void st_collections_group_parts_part_description_orientation_look1(void);
377static void st_collections_group_parts_part_description_orientation_look2(void); 377static void st_collections_group_parts_part_description_orientation_look2(void);
378static void st_collections_group_parts_part_description_orientation_look_to(void); 378static void st_collections_group_parts_part_description_orientation_look_to(void);
379static void st_collections_group_parts_part_description_orientation_angle_axis(void);
380static void st_collections_group_parts_part_description_orientation_quaternion(void);
379 381
380#ifdef HAVE_EPHYSICS 382#ifdef HAVE_EPHYSICS
381static void st_collections_group_parts_part_description_physics_mass(void); 383static void st_collections_group_parts_part_description_physics_mass(void);
@@ -565,6 +567,32 @@ static void st_collections_group_nobroadcast(void);
565 ed->type_node.orientation.type = EVAS_3D_NODE_ORIENTATION_TYPE_LOOK_TO; \ 567 ed->type_node.orientation.type = EVAS_3D_NODE_ORIENTATION_TYPE_LOOK_TO; \
566 } 568 }
567 569
570#define SET_ANGLE_AXIS(Type, type_node) \
571 Edje_Part_Description_##Type *ed; \
572 ed = (Edje_Part_Description_##Type*) current_desc; \
573 \
574 if (ed->type_node.orientation.type <= EVAS_3D_NODE_ORIENTATION_TYPE_ANGLE_AXIS) \
575 { \
576 ed->type_node.orientation.data[0] = FROM_DOUBLE(parse_float(0)); \
577 ed->type_node.orientation.data[1] = FROM_DOUBLE(parse_float(1)); \
578 ed->type_node.orientation.data[2] = FROM_DOUBLE(parse_float(2)); \
579 ed->type_node.orientation.data[3] = FROM_DOUBLE(parse_float(3)); \
580 ed->type_node.orientation.type = EVAS_3D_NODE_ORIENTATION_TYPE_ANGLE_AXIS; \
581 }
582
583#define SET_QUATERNION(Type, type_node) \
584 Edje_Part_Description_##Type *ed; \
585 ed = (Edje_Part_Description_##Type*) current_desc; \
586 \
587 if (ed->type_node.orientation.type <= EVAS_3D_NODE_ORIENTATION_TYPE_QUATERNION) \
588 { \
589 ed->type_node.orientation.data[1] = FROM_DOUBLE(parse_float(0)); \
590 ed->type_node.orientation.data[2] = FROM_DOUBLE(parse_float(1)); \
591 ed->type_node.orientation.data[3] = FROM_DOUBLE(parse_float(2)); \
592 ed->type_node.orientation.data[0] = FROM_DOUBLE(parse_float(3)); \
593 ed->type_node.orientation.type = EVAS_3D_NODE_ORIENTATION_TYPE_QUATERNION; \
594 }
595
568New_Statement_Handler statement_handlers[] = 596New_Statement_Handler statement_handlers[] =
569{ 597{
570 {"externals.external", st_externals_external}, 598 {"externals.external", st_externals_external},
@@ -778,6 +806,8 @@ New_Statement_Handler statement_handlers[] =
778 {"collections.group.parts.part.description.orientation.look1", st_collections_group_parts_part_description_orientation_look1}, 806 {"collections.group.parts.part.description.orientation.look1", st_collections_group_parts_part_description_orientation_look1},
779 {"collections.group.parts.part.description.orientation.look2", st_collections_group_parts_part_description_orientation_look2}, 807 {"collections.group.parts.part.description.orientation.look2", st_collections_group_parts_part_description_orientation_look2},
780 {"collections.group.parts.part.description.orientation.look_to", st_collections_group_parts_part_description_orientation_look_to}, 808 {"collections.group.parts.part.description.orientation.look_to", st_collections_group_parts_part_description_orientation_look_to},
809 {"collections.group.parts.part.description.orientation.angle_axis", st_collections_group_parts_part_description_orientation_angle_axis},
810 {"collections.group.parts.part.description.orientation.quaternion", st_collections_group_parts_part_description_orientation_quaternion},
781 811
782#ifdef HAVE_EPHYSICS 812#ifdef HAVE_EPHYSICS
783 {"collections.group.parts.part.description.physics.mass", st_collections_group_parts_part_description_physics_mass}, 813 {"collections.group.parts.part.description.physics.mass", st_collections_group_parts_part_description_physics_mass},
@@ -9686,6 +9716,76 @@ st_collections_group_parts_part_description_orientation_look_to(void)
9686 } 9716 }
9687} 9717}
9688 9718
9719/**
9720 @page edcref
9721 @property
9722 angle_axis
9723 @parameters
9724 [x] [y] [z] [w]
9725 @effect
9726 Specifies the angle and indicates what proportions the MESH_NODE rotates in.
9727 @endproperty
9728*/
9729static void
9730st_collections_group_parts_part_description_orientation_angle_axis(void)
9731{
9732 check_arg_count(4);
9733
9734 if (current_part->type == EDJE_PART_TYPE_CAMERA)
9735 {
9736 SET_ANGLE_AXIS(Camera, camera)
9737 }
9738 else if (current_part->type == EDJE_PART_TYPE_LIGHT)
9739 {
9740 SET_ANGLE_AXIS(Light, light)
9741 }
9742 else if (current_part->type == EDJE_PART_TYPE_MESH_NODE)
9743 {
9744 SET_ANGLE_AXIS(Mesh_Node, mesh_node)
9745 }
9746 else
9747 {
9748 ERR("parse error %s:%i. camera, light and mesh_node attributes in non-CAMERA, non-LIGHT and non-MESH_NODE part.",
9749 file_in, line - 1);
9750 exit(-1);
9751 }
9752}
9753
9754
9755/**
9756 @page edcref
9757 @property
9758 quaternion
9759 @parameters
9760 [x] [y] [z] [w]
9761 @effect
9762 Specifies the axis and arccosinus of half angle to rotate on the MESH_NODE, CAMERA or LIGHT.
9763 @endproperty
9764*/
9765static void
9766st_collections_group_parts_part_description_orientation_quaternion(void)
9767{
9768 check_arg_count(4);
9769
9770 if (current_part->type == EDJE_PART_TYPE_CAMERA)
9771 {
9772 SET_QUATERNION(Camera, camera)
9773 }
9774 else if (current_part->type == EDJE_PART_TYPE_LIGHT)
9775 {
9776 SET_QUATERNION(Light, light)
9777 }
9778 else if (current_part->type == EDJE_PART_TYPE_MESH_NODE)
9779 {
9780 SET_QUATERNION(Mesh_Node, mesh_node)
9781 }
9782 else
9783 {
9784 ERR("parse error %s:%i. camera, light and mesh_node attributes in non-CAMERA, non-LIGHT and non-MESH_NODE part.",
9785 file_in, line - 1);
9786 exit(-1);
9787 }
9788}
9689 9789
9690static void 9790static void
9691st_collections_group_parts_part_description_proxy_source_visible(void) 9791st_collections_group_parts_part_description_proxy_source_visible(void)