Fix for small mouse movements
-
- Petrif-Eyed
- Posts: 2166
- Joined: Mon Jun 22, 2009 8:36 am
- Location: Stockholm, Sweden
Fix for small mouse movements
I think this is the number one feature that needs to be fixed for next release so I created a new thread for it.
See this branch
https://github.com/AndersMalmgren/FreeP ... ePlugin.cs
Problem is that Baggyg's code drift for some plugins while the old solution did not
See this branch
https://github.com/AndersMalmgren/FreeP ... ePlugin.cs
Problem is that Baggyg's code drift for some plugins while the old solution did not
- baggyg
- Vireio Perception Developer
- Posts: 491
- Joined: Sat May 19, 2012 5:20 am
- Location: BB, Slovakia
Re: Fix for small mouse movements
Code: Select all
// Reset the mouse values
if ((int) DeltaXOut != 0)
{
DeltaXOut = DeltaXOut - (int) DeltaXOut;
}
if ((int) DeltaYOut != 0)
{
DeltaYOut = DeltaYOut - (int) DeltaYOut;
}
Code: Select all
// Reset the mouse values
DeltaXOut = DeltaXOut - (int) DeltaXOut;
DeltaYOut = DeltaYOut - (int) DeltaYOut;
I have a couple of ideas how to achieve this so will download your latest branch and try although probably wont be until sometime next week.
- RescueGamer
- Cross Eyed!
- Posts: 108
- Joined: Thu May 16, 2013 1:02 am
Re: Fix for small mouse movements
so, with this new mouse plugin the small sensors movements are better recognised for mouse purposes?
- baggyg
- Vireio Perception Developer
- Posts: 491
- Joined: Sat May 19, 2012 5:20 am
- Location: BB, Slovakia
Re: Fix for small mouse movements
Yes I have a version working here, that even very small precise movements are shown and feels natural with a Rift or YEI. However CyberVillian is worried about the change affecting the behaviour of some of the other plugins as he has seen some unwanted side effects. We are currently trying to resolve these side issues before a release.RescueGamer wrote:so, with this new mouse plugin the small sensors movements are better recognised for mouse purposes?
- RescueGamer
- Cross Eyed!
- Posts: 108
- Joined: Thu May 16, 2013 1:02 am
Re: Fix for small mouse movements
Ok, then I don't have to use this with my android device XD
-
- Petrif-Eyed
- Posts: 2166
- Joined: Mon Jun 22, 2009 8:36 am
- Location: Stockholm, Sweden
Re: Fix for small mouse movements
Well yes, try to move your phone just slightly, it will not move. So its the same problem for Android.
- RescueGamer
- Cross Eyed!
- Posts: 108
- Joined: Thu May 16, 2013 1:02 am
Re: Fix for small mouse movements
Oks, i'll give it a try, i'll tell you what I get
-
- Petrif-Eyed
- Posts: 2166
- Joined: Mon Jun 22, 2009 8:36 am
- Location: Stockholm, Sweden
Re: Fix for small mouse movements
Updated the branch, I now use Baggyg's code. I have also added a deadband filter that can be used for devices with small drift. Please try it out, this works pretty well for me and my Android.
Code: Select all
def update():
x = filters.deadband(filters.delta(math.degrees(android.yaw)), 0.01)
y = filters.deadband(filters.delta(math.degrees(android.roll)), 0.01)
if x <> 0:
diagnostics.watch(x)
if y <> 0:
diagnostics.watch(y)
mouse.deltaX = x * 5
mouse.deltaY = y * 5
if starting:
android.update += update
- baggyg
- Vireio Perception Developer
- Posts: 491
- Joined: Sat May 19, 2012 5:20 am
- Location: BB, Slovakia
Re: Fix for small mouse movements
Hi Cyber,
Tried your code here on the YEI and all working fine. With the right settings on the YEI suite the deadband wasn't needed, but changed the trust levels to emulate a bit of drift and the deadband works well. Its a good tradeoff to let the user decide the deadband level, but keep the accuracy of the <0.5 figures for small mouse movements.
One small efficiency change. Line 92 of MousePlugin.cs
should be
Since we don't need to send anything to the mouse if there is no movement.
Apart from that I think this is ready to be released.
Tried your code here on the YEI and all working fine. With the right settings on the YEI suite the deadband wasn't needed, but changed the trust levels to emulate a bit of drift and the deadband works well. Its a good tradeoff to let the user decide the deadband level, but keep the accuracy of the <0.5 figures for small mouse movements.
One small efficiency change. Line 92 of MousePlugin.cs
Code: Select all
if ((deltaXOut != 0) || (deltaYOut != 0))
Code: Select all
if ((int)deltaXOut != 0 || (int)deltaYOut != 0)
Apart from that I think this is ready to be released.