game2006/server/gameserver/collision.h
aozhiwei a4f68c9147 1
2023-11-21 11:12:07 +08:00

31 lines
902 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);
static bool InSquare(const glm::vec3& center, const glm::vec3& pos, float side_len);
};