I would ideally need a mouse delta for several stuff. (on mtcontrol type module)
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?
Mouse Deta, best strategy to get?
sry never mind found a way to go.^^
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);
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);
-
martignasse
- Site Admin
- Posts: 611
- Location: Lyon, FRANCE
- Contact:
you can check the GranulatorModule.cpp, it do exactly that
try to avoid global static variable, as they can collide if you have more that one module instance. Prefer class member variable
try to avoid global static variable, as they can collide if you have more that one module instance. Prefer class member variable
Martin FLEURENT - Usine Developer - SDK maintainer
i was wondering that and was about to ask, tahnks 4 the clue!
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
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
Who is online
Users browsing this forum: No registered users and 94 guests
