Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicate 'add ptr' events being incorrectly generated #10

Open
ruigomessilva opened this issue Apr 22, 2022 · 0 comments
Open

Duplicate 'add ptr' events being incorrectly generated #10

ruigomessilva opened this issue Apr 22, 2022 · 0 comments

Comments

@ruigomessilva
Copy link

ruigomessilva commented Apr 22, 2022

When receiving two pointers with the same data, the reference implementation incorrectly generates two 'add ptr' events for the same session ID.

Consider the following 3 TUIO bundles, being processed by the Tuio2Dump demo application:

/tuio2/frm 20668 7089359197171840187 537399850 Ultra 022001000104
/tuio2/alv

/tuio2/frm 20669 7089359197438128160 537399850 Ultra 022001000104
/tuio2/ptr 101027 65536 0 0.409512 0.49871 0 0 0 0.136719
/tuio2/alv 101027

/tuio2/frm 20670 7089359197695826198 537399850 Ultra 022001000104
/tuio2/ptr 101027 65536 0 0.409512 0.49871 0 0 0 0.136719
/tuio2/alv 101027

This will generate two 'add ptr' events for pointer with session ID 101027, although, frame 20669 should generate a 'add ptr' and frame 20670 should generate a 'set ptr' event.

My suspicion, is that here:

if (tptr == NULL) {
tptr = new TuioPointer(frameTime,tobj,t_id,u_id,c_id,xpos,ypos,angle,shear,radius,pressure);
tobj->setTuioPointer(tptr);
} else if ( (tptr->getX()!=xpos) || (tptr->getY()!=ypos) || (tptr->getAngle()!=angle) || (tptr->getShear()!=shear) || (tptr->getRadius()!=radius) || (tptr->getPressure()!=pressure) || (tptr->getXSpeed()!=xspeed) || (tptr->getYSpeed()!=yspeed) || (tptr->getPressureSpeed()!=pspeed) || (tptr->getMotionAccel()!=maccel) || (tptr->getPressureAccel()!=paccel) ) {
tptr->update(frameTime,xpos,ypos,angle,shear,radius,pressure,xspeed,yspeed,pspeed,maccel,paccel);
}

the update event should occur even if the pointer data is the same, as long as the time is different.

Is my interpretation correct, or am I missing something?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant