Skip to content

Duplicate 'add ptr' events being incorrectly generated #10

Description

@ruigomessilva

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions