i making c++ program rectangles on that's needed drag whether horizontally or vertically clicking on them , checking if other rectangles collide onto it. now, in situation, have case if user moves mouse fast. collision detection won't work, mean, the other coordinates skipped out or jump out on large distance
. assuming adding mouse sensitivity on program can change unwanted behavior.
i use glfw
windowing. think glfwsetmousepos()
can want don't know math should apply attain this. , if possible, don't want use other libraries. can show code how this?
thanks!
update
sadly know, mouse sensitivity not issue in case. think can work around expanding code lots of if
. however, looking kind of question, suggest this. can use separate program running code.
sounds need collision detection algorithm handles penetration @ speed.
look sweeping collision detection. it's pretty how physics engines work.
Comments
Post a Comment