Mantis - Croquet
Viewing Issue Advanced Details
826 Jasmine minor always 01-14-05 01:02 01-27-05 21:06
0000826: TDragger issue
If you grab an TDragger object with the cursor at say the center of the screen,
and then holding down the mouse button drag it here and there for a while
and then return the cursor to the center of the screen,
the dragged object will no longer be in the center of the screen.

I think the expected behaviour would that each location of the cursor
should correspond to a single location of the TDragger, regardless of
cursor movement history.

The effect can be quite large
and sometimes i lose objects off the side of the viewport
and need to chase them with the avatar.
 TDraggerFix-daf.1.cs [^] (2,363 bytes) 01-16-05 17:32
 TDraggerFix-oxe.1.cs [^] (1,544 bytes) 01-27-05 21:05

01-15-05 06:08   
This happens when you move the object back and and forth; the movement in the plane assume constant distance. It works fine when you only shift-drag the object.
01-16-05 17:37   
Here is a potential fix. This pretty much replaces these methods with code copied fairly directly from TWindow (I just did this same thing for the ODE demos). They now use the local frame of reference instead of the global, for the most part. I was not able to test the methods called when controlKeyPressed is true because when I try to use the control key and left-click or right-click, I get a menu. Is this another bug?
01-24-05 22:34   
The fix looks good to me! Thanks!

I made one small modification for myself tho -
i notice that when an object is dragged beyond the horizon,
it 'comes back', which is excellent, but it also moves to
a different plane. (Looks like the plane reflected across Y at the camera).
For my purposes this is inconvenient, so i added the following line right after "delta _ p - p0." :

delta y: 0.0.
01-25-05 15:15   
If you make your change so that the movement plane is not reflected when passing the horizon, doesn't that mean that the object is no longer tracking exactly to the mouse cursor?
01-25-05 21:23   
yes indeedy,
but i felt that having a cursor/dragger discrepancy
was preferable to having the dragger move out of its
original plane.

ie, it seems to me that the behavior of a dragger
in response to a plain click-and-drag should be
to move within the horizontal plane it's already in,
and not move out of it.

another option would be to simply leave the object at
the horizon when the cursor crosses the horizon,
but again it seems more useful to me to have the object return.
01-26-05 00:50   
note - for those who do want the dragger to remain in the originally specified plane, my fix above should really be the more general this:

    "remove component perpendicular to plane"
    perp _ plainNormal * (delta dot: plainNormal).
    delta _ delta - perp.

(change "delta y: 0." to that)
01-27-05 21:06   
added change set which corrects for rotation of parent frames
and the TDragger's own rotation.

(it also restricts the dragger to stay in it's original plane :)