game2006/server/gameserver/collision.h
aozhiwei 732e1fbe23 1
2023-01-02 09:20:43 +08:00

28 lines
771 B
C++

#pragma once
class IBullet;
class Creature;
class Obstacle;
class Collision
{
public:
static bool CheckBullet(IBullet* bullet, Creature* c);
static bool CheckBullet(IBullet* bullet, Entity* c);
static bool CheckCC(Creature* a, Creature* b);
static bool CheckCC(Creature* a, float radius, Creature* b, float radis);
static bool CheckCB(Creature* c, Obstacle* b);
static bool CheckCB(Creature* c, float c_radius, Obstacle* b, float b_radius);
/*
--圆与旋转矩形碰撞
--rx ry 圆坐标
--r 圆半径
--dx dy 矩形坐标
--dw dh 矩形长宽
--dro 矩形旋转角度
*/
static bool Check2dRotationRectangle(float rx, float ry, float r, float dx, float dy, float dw, float dh, float dro);
};