ArrayArrayArrayArray BrainModular BrainModular Users Forum 2015-04-22T19:08:44+02:00 https://www.brainmodular.com/forums/app.php/feed/topic/4865 2015-04-22T19:08:44+02:00 2015-04-22T19:08:44+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=4865&p=32452#p32452 <![CDATA[Mouse Deta, best strategy to get?]]> how i missed that in the exemple, have definitely to recheck them all ;)
i first made tons of static stuff in top of made code^^, now i put them all in header without static

Statistics: Posted by 23fx23 — 22 Apr 2015, 19:08


]]>
2015-04-22T17:54:07+02:00 2015-04-22T17:54:07+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=4865&p=32448#p32448 <![CDATA[Mouse Deta, best strategy to get?]]>
try to avoid global static variable, as they can collide if you have more that one module instance. Prefer class member variable

Statistics: Posted by martignasse — 22 Apr 2015, 17:54


]]>
2015-04-20T16:53:49+02:00 2015-04-20T16:53:49+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=4865&p=32366#p32366 <![CDATA[Mouse Deta, best strategy to get?]]> if interested in (maybe not the best way but works)

created static float vars prevX and deta, at top of code. init them booth at 0 on ::onMouseDown

then in :: onMouseMove code looks like:

delta = X - prevX;

if (delta !=0)
{
DELTA_LOCK_DIR = (delta > 0);
prevX = X;
}

sdkTraceInt(DELTA_LOCK_DIR);

Statistics: Posted by 23fx23 — 20 Apr 2015, 16:53


]]>
2015-04-20T16:41:52+02:00 2015-04-20T16:41:52+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=4865&p=32365#p32365 <![CDATA[Mouse Deta, best strategy to get?]]> i dlike to see while moving if going left or right (and later maybe acceleration, so delta seems the best variable)

I will investigate and repport my finds but I was wondering what would be most efficient stategy to get it, in terms of cpu and easyness.

sounds not the best way to make process active just for this, but maybe it's the only way to go?,
or maybe make/set a 'physical' parameter and compare would work. will try.

could there be a trick code im not aware of, to directly get this on the ::onmove callback without process or setting a param?

any global ideas?

Statistics: Posted by 23fx23 — 20 Apr 2015, 16:41


]]>
BrainModular BrainModular Users Forum 2015-04-22T19:08:44+02:00 https://www.brainmodular.com/forums/app.php/feed/topic/4865 2015-04-22T19:08:44+02:00 2015-04-22T19:08:44+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=4865&p=32452#p32452 <![CDATA[Mouse Deta, best strategy to get?]]> how i missed that in the exemple, have definitely to recheck them all ;)
i first made tons of static stuff in top of made code^^, now i put them all in header without static

Statistics: Posted by 23fx23 — 22 Apr 2015, 19:08


]]>
2015-04-22T17:54:07+02:00 2015-04-22T17:54:07+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=4865&p=32448#p32448 <![CDATA[Mouse Deta, best strategy to get?]]>
try to avoid global static variable, as they can collide if you have more that one module instance. Prefer class member variable

Statistics: Posted by martignasse — 22 Apr 2015, 17:54


]]>
2015-04-20T16:53:49+02:00 2015-04-20T16:53:49+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=4865&p=32366#p32366 <![CDATA[Mouse Deta, best strategy to get?]]> if interested in (maybe not the best way but works)

created static float vars prevX and deta, at top of code. init them booth at 0 on ::onMouseDown

then in :: onMouseMove code looks like:

delta = X - prevX;

if (delta !=0)
{
DELTA_LOCK_DIR = (delta > 0);
prevX = X;
}

sdkTraceInt(DELTA_LOCK_DIR);

Statistics: Posted by 23fx23 — 20 Apr 2015, 16:53


]]>
2015-04-20T16:41:52+02:00 2015-04-20T16:41:52+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=4865&p=32365#p32365 <![CDATA[Mouse Deta, best strategy to get?]]> i dlike to see while moving if going left or right (and later maybe acceleration, so delta seems the best variable)

I will investigate and repport my finds but I was wondering what would be most efficient stategy to get it, in terms of cpu and easyness.

sounds not the best way to make process active just for this, but maybe it's the only way to go?,
or maybe make/set a 'physical' parameter and compare would work. will try.

could there be a trick code im not aware of, to directly get this on the ::onmove callback without process or setting a param?

any global ideas?

Statistics: Posted by 23fx23 — 20 Apr 2015, 16:41


]]>