要求:1,界面上有静态物体若干,静态物体有方形的,圆形的,两条线组成的道路,还有曲折的线。(GDI+画)
2,有一个长方形的动态物体,随鼠标移动而移动!
3,动态物体在移动过程中不得与静态物体相撞,如果相撞,静态物体则发生变化。
重点:随鼠标移动的方形物体,与静态物体不能有任何角度的接触。
2,有一个长方形的动态物体,随鼠标移动而移动!
3,动态物体在移动过程中不得与静态物体相撞,如果相撞,静态物体则发生变化。
重点:随鼠标移动的方形物体,与静态物体不能有任何角度的接触。
My code is simple but you might need some geometry knowledge to understand it.请教一下:C#如何实现在一个矩形框内四次反射
But there are optimizations for complex scene, like Bounding Box, // a bounding box is a rectangle, so it is easier for pre-intersect-detection than a circle
Spatial partitioning, // divide the space into sub-spaces and hit-test within the smaller area
Temporal coherence, // a far away object is unlikely to intersect the next moment
...