john-chapman/im3d

Snapping is broken for non-xyz translation

Closed this issue · 6 comments

Sometimes when the snapping value is set above 0.0f any translation on (XY, YZ, XZ, or View) results in the position to be set to NAN.

(Sorry I closed this issue by mistake).

I don't think I saw this before, is it just an issue when using snapping or does it happen under normal use of the gizmos?

It only happens with snapping enabled. my program is a bit different than the demos (most relevant probably being it uses Z up).
Its a little hard to describe the behavior, I'll just quickly demonstrate it in a video here:
https://www.youtube.com/watch?v=Poi5M1W_YfM&feature=youtu.be
(apologies for the audio issues, I'm not sure what is causing this)
It sometimes doesn't behave like this but I'm not quite sure why.

(Edit:)
(I was able to capture it working somewhat earlier but as soon as I grab the middle it Nans)
https://www.youtube.com/watch?v=okKOX6h8e54&feature=youtu.be

Ok, thanks for the info - video is very useful for repro on this kind of issue, so thanks for that. I'll take a look at this during the weekend and get back to you asap.

This should now be fixed. The issue was happening only when the position of the gizmo was 0,0,0 (there was a divide-by-zero in the code).

Alright, I'll test it out as soon as I can and get back to you.

Yep, that fixed it thank you!