The problem was simple, just transform the global coordinates of t->tsnap.snapTarget to local coordinates. (Some comments were added to the code)
The problem was simple, just transform the global coordinates of t->tsnap.snapTarget to local coordinates. (Some comments were added to the code)