STATE_MAP_BACK_CULL = 39,
STATE_MAP_PERSP_ON = 40,
STATE_PERSP_ZPLANE = 41,
- STATE_PERSP_FOCAL = 42
+ STATE_PERSP_FOCAL = 42,
+ STATE_PHYSICS_MASS = 43,
+ STATE_PHYSICS_FRICTION = 44,
+ STATE_PHYSICS_RESTITUTION = 45
};
native set_state_val(part_id, State_Param:p, ...);
target: "blue_circle";
}
+ program {
+ name: "customize";
+ signal: "custom";
+ script {
+ new Float: mass, Float:rest, Float:fric;
+
+ custom_state(PART:"red_circle", "default", 0.0);
+ set_state_val(PART:"red_circle", STATE_COLOR, 0, 0, 0, 255);
+ set_state_val(PART:"red_circle", STATE_PHYSICS_MASS, 4.5);
+ set_state_val(PART:"red_circle", STATE_PHYSICS_RESTITUTION, 0.1);
+ set_state_val(PART:"red_circle", STATE_PHYSICS_FRICTION, 0.345);
+ set_state(PART:"red_circle", "custom", 0.0);
+
+ get_state_val(PART:"red_circle", STATE_PHYSICS_MASS, mass);
+ get_state_val(PART:"red_circle", STATE_PHYSICS_RESTITUTION,
+ rest);
+ get_state_val(PART:"red_circle", STATE_PHYSICS_FRICTION,
+ fric);
+ send_message(MSG_STRING_FLOAT_SET, 1, "Mass", mass);
+ send_message(MSG_STRING_FLOAT_SET, 1, "Friction", fric);
+ send_message(MSG_STRING_FLOAT_SET, 1, "Restitution", rest);
+ }
+ }
+
}
}
GETINT(rp->custom->description->persp.focal, params[3]);
break;
+#ifdef HAVE_EPHYSICS
+ case EDJE_STATE_PARAM_PHYSICS_MASS:
+ CHKPARAM(3);
+
+ GETFLOAT_T(rp->custom->description->physics.mass, params[3]);
+
+ break;
+ case EDJE_STATE_PARAM_PHYSICS_RESTITUTION:
+ CHKPARAM(3);
+
+ GETFLOAT_T(rp->custom->description->physics.restitution, params[3]);
+
+ break;
+ case EDJE_STATE_PARAM_PHYSICS_FRICTION:
+ CHKPARAM(3);
+
+ GETFLOAT_T(rp->custom->description->physics.friction, params[3]);
+
+ break;
+#endif
default:
break;
}
SETINT(rp->custom->description->visible, params[3]);
break;
+#ifdef HAVE_EPHYSICS
+ case EDJE_STATE_PARAM_PHYSICS_MASS:
+ CHKPARAM(3);
+
+ SETFLOAT_T(rp->custom->description->physics.mass, params[3]);
+
+ break;
+ case EDJE_STATE_PARAM_PHYSICS_RESTITUTION:
+ CHKPARAM(3);
+
+ SETFLOAT_T(rp->custom->description->physics.restitution, params[3]);
+
+ break;
+ case EDJE_STATE_PARAM_PHYSICS_FRICTION:
+ CHKPARAM(3);
+
+ SETFLOAT_T(rp->custom->description->physics.friction, params[3]);
+
+ break;
+#endif
default:
break;
}
#define EDJE_STATE_PARAM_MAP_PERSP_ON 40
#define EDJE_STATE_PARAM_PERSP_ZPLANE 41
#define EDJE_STATE_PARAM_PERSP_FOCAL 42
-#define EDJE_STATE_PARAM_LAST 43
+#define EDJE_STATE_PARAM_PHYSICS_MASS 43
+#define EDJE_STATE_PARAM_PHYSICS_FRICTION 44
+#define EDJE_STATE_PARAM_PHYSICS_RESTITUTION 45
+#define EDJE_STATE_PARAM_LAST 46
#define EDJE_ENTRY_EDIT_MODE_NONE 0
#define EDJE_ENTRY_EDIT_MODE_SELECTABLE 1