free(part);
}
#ifdef HAVE_EPHYSICS
- else if (ep->action == EDJE_ACTION_TYPE_PHYSICS_IMPULSE)
+ else if ((ep->action == EDJE_ACTION_TYPE_PHYSICS_IMPULSE) ||
+ (ep->action == EDJE_ACTION_TYPE_PHYSICS_TORQUE_IMPULSE))
{
- ep->physics.impulse.x = parse_float(1);
- ep->physics.impulse.y = parse_float(2);
- ep->physics.impulse.z = parse_float(3);
- }
- else if (ep->action == EDJE_ACTION_TYPE_PHYSICS_TORQUE_IMPULSE)
- {
- ep->physics.impulse.x = parse_float(1);
- ep->physics.impulse.y = parse_float(2);
- ep->physics.impulse.z = parse_float(3);
+ ep->physics.x = parse_float(1);
+ ep->physics.y = parse_float(2);
+ ep->physics.z = parse_float(3);
}
#endif
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_program, Edje_Program, "param.dst", param.dst, EET_T_INT);
#ifdef HAVE_EPHYSICS
- EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_program, Edje_Program, "physics.impulse.x", physics.impulse.x, EET_T_DOUBLE);
- EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_program, Edje_Program, "physics.impulse.y", physics.impulse.y, EET_T_DOUBLE);
- EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_program, Edje_Program, "physics.impulse.z", physics.impulse.z, EET_T_DOUBLE);
+ EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_program, Edje_Program, "physics.x", physics.x, EET_T_DOUBLE);
+ EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_program, Edje_Program, "physics.y", physics.y, EET_T_DOUBLE);
+ EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_program, Edje_Program, "physics.z", physics.z, EET_T_DOUBLE);
#endif
EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&eddc, Edje_Part_Image_Id);
} param;
#ifdef HAVE_EPHYSICS
- /* used for actions related to physics, as PHYSICS_IMPULSE */
+ /* used for actions related to physics, as physics impulses and forces */
struct {
- struct {
- double x;
- double y;
- double z;
- } impulse;
+ double x;
+ double y;
+ double z;
} physics;
#endif
rp = ed->table_parts[pt->id % ed->table_parts_size];
if ((rp) && (rp->body))
ephysics_body_central_impulse_apply(
- rp->body, pr->physics.impulse.x, pr->physics.impulse.y,
- pr->physics.impulse.z);
+ rp->body, pr->physics.x, pr->physics.y, pr->physics.z);
}
}
break;
rp = ed->table_parts[pt->id % ed->table_parts_size];
if ((rp) && (rp->body))
ephysics_body_torque_impulse_apply(
- rp->body, pr->physics.impulse.x, pr->physics.impulse.y,
- pr->physics.impulse.z);
+ rp->body, pr->physics.x, pr->physics.y, pr->physics.z);
}
}
break;