X-Git-Url: https://fleuret.org/cgi-bin/gitweb/gitweb.cgi?a=blobdiff_plain;f=manipulator.h;h=cd44a6d7ab279bfaaa3716537a114428e3be971b;hb=8697ab57c9138aa2bb1657a971e4c2cc5e4a1606;hp=0b8c0a1f0143c2d52a5c1ad9c816167dd07bc528;hpb=3caf13085a6ae1ae41d6f489c8b69206b0ffa48d;p=universe.git diff --git a/manipulator.h b/manipulator.h index 0b8c0a1..cd44a6d 100644 --- a/manipulator.h +++ b/manipulator.h @@ -12,6 +12,7 @@ class Manipulator : public Map { static const int sqsize = 16; + Polygon *_touching_polygon, *_current_polygon; scalar_t _grab_relative_x, _grab_relative_y; scalar_t _xmax, _ymax; @@ -19,15 +20,24 @@ class Manipulator : public Map { scalar_t _force_x, _force_y; bool _grab, _release; int _current_action; + enum { FEEL_TOUCHING_OBJECT, FEEL_GRABBING_OBJECT, NB_DISCRETE_PARAMETERS }; + enum { MAP_LOCATION_X, MAP_LOCATION_Y, MAP_RESISTANCE_X, MAP_RESISTANCE_Y, NB_CONTINUOUS_MAPS }; + static const int continuous_map_size = 25; + scalar_t _kernel_continuous_maps[continuous_map_size * 2 + 1]; + public: - enum { ACTION_IDLE, - ACTION_MOVE_UP, ACTION_MOVE_RIGHT, ACTION_MOVE_DOWN, ACTION_MOVE_LEFT, - ACTION_GRAB, ACTION_RELEASE, - NB_ACTIONS }; + + enum { + ACTION_IDLE, + ACTION_MOVE_UP, ACTION_MOVE_RIGHT, ACTION_MOVE_DOWN, ACTION_MOVE_LEFT, + ACTION_GRAB, ACTION_RELEASE, + NB_ACTIONS + }; + Manipulator(Task *task); inline scalar_t hand_x() { return _hand_x; } @@ -47,7 +57,7 @@ public: int random_action(); -// void force_grab(Universe *universe, scalar_t x, scalar_t y); + // void force_grab(Universe *universe, scalar_t x, scalar_t y); void force_move(scalar_t x, scalar_t y); void force_release(); };