Closed jawaff closed 8 years ago
Analog reactions -- such as the mouse movement reaction -- should be able to access the Gesture object that they belong to. In addition, the Gesture object should be able to store the Rule objects, so that the analog reactions are able to lookup specific Rule objects that will instruct the reaction on what is to be done.
For example, a mouse movement reaction would be able to lookup its Gesture and then lookup the PositionX/PositionY/PositionZ and maybe Angle rules for the right hand. This would allow the reaction to figure out how fast the mouse needs to move and in what direction. Hopefully these calculations won't be too slow when they're implemented.
Anyway, I'm going to continue my research and will log any other changes to the plan for mouse movement reactions.
A few things need to be added to the config.jj file for the mouse gesture:
It might make sense to start out making a child Gesture class that is specifically meant for the mouse control gesture. Then the Gesture class additions wouldn't have to be generic for any analog gesture. That may be a good or bad thing though. I need to figure out what other kinds of analog Gestures could exist in the future.
Straight from the todos of config/config.jj:
//TODO Important: Make this gesture able to be triggered repeatedly. The Esper query would need altered.
//TODO Create a specific gesture class that is designed to handle the mouse control. It needs to keep around the
//angle rule objects and give them to the reactions as they are updated.
//TODO Look into pushing more of this configuration stuff back into some other Java files. The .jj file should be for parsing and that is it.
//TODO Create some sort of reaction that will grab the above angle rules and move the mouse.
I've started adding a MouseReaction to the emulation package of the project and I'm unsure how to continue with this. Should I have Esper continuously triggering reaction while the user's arm is extended. Or should I make Esper in charge of turning on and turning off a 'switch' for the mouse reaction.
Required Criteria:
I ended up implementing PersistentReactions into the emulation package and made them able to be responsible for stopping themselves so that Esper wouldn't have to.
So besides for a few tweaks to the smoothness and analog nature of the mouse control gesture, it is done.
I had to fix quite a bit of things with the original setup. It was correct for the most part, but I had some trigonometry errors in the latter half of the MouseReaction class' trigger() method. Anyway, the mouse movement gesture works like a charm!
I'm not sure how this part will work yet. I will report about my ideas when I can though until I start implementing it.