摘要:
这里总结了一下点、圆、矩形之间的简单碰撞检测算法 (ps:矩形不包括旋转状态) 点和圆的碰撞检测: 1.计算点和圆心的距离 2.判断点与圆心的距离是否小于圆的半 isCollision: function(point, circle) isCollision: function(point, cir 阅读全文
posted @ 2018-08-08 19:48
星月相随
阅读(937)
评论(0)
推荐(0)
摘要:
// f:矩形// // f_rotation 矩形旋转角度 // c: 圆形 bool collision( float f_x, float f_y, float f_width, float f_height, float f_rotation, float c_x, float c_y, float c_radius) { float sint, cost; ... 阅读全文
posted @ 2018-08-08 19:44
星月相随
阅读(335)
评论(0)
推荐(0)
摘要:
假设对图片上任意点(x,y),绕一个坐标点(rx0,ry0)逆时针旋转a角度后的新的坐标设为(x0, y0),有公式:x0= (x - rx0)*cos(a) - (y - ry0)*sin(a) + rx0 ;y0= (x - rx0)*sin(a) + (y - ry0)*cos(a) + ry 阅读全文
posted @ 2018-08-08 18:28
星月相随
阅读(4366)
评论(0)
推荐(0)

浙公网安备 33010602011771号