1
This commit is contained in:
parent
97e48f3410
commit
a4f68c9147
@ -22,7 +22,8 @@ class Collision
|
||||
--dw dh 矩形长宽
|
||||
--dro 矩形旋转角度
|
||||
*/
|
||||
static bool Check2dRotationRectangle(float rx, float ry, float r, float dx, float dy, float dw, float dh, float 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);
|
||||
|
||||
|
@ -901,24 +901,27 @@ void RoomObstacle::RemoveSameSkillObstacle()
|
||||
void RoomObstacle::ActiveFlameSurface()
|
||||
{
|
||||
ForceGridList();
|
||||
glm::vec3 dir = GlmHelper::UP;
|
||||
GlmHelper::RotateY(dir, rotate_);
|
||||
glm::vec3 adjusted_pos = GetPos().ToGlmVec3() + dir * (meta->height() / 2.0f);
|
||||
auto cb =
|
||||
[this] ()
|
||||
[this, adjusted_pos] ()
|
||||
{
|
||||
std::set<Human*> human_list;
|
||||
room->grid_service->TraverseAllLayerHumanList
|
||||
(room->GetRoomIdx(),
|
||||
*grid_list_,
|
||||
[this, &human_list] (Human* hum, bool& stop)
|
||||
[this, &human_list, &adjusted_pos] (Human* hum, bool& stop)
|
||||
{
|
||||
if (Collision::Check2dRotationRectangle
|
||||
(
|
||||
hum->GetPos().GetX(),
|
||||
hum->GetPos().GetZ(),
|
||||
hum->GetHitRadius(),
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
adjusted_pos.x,
|
||||
adjusted_pos.z,
|
||||
meta->width() / 2.0f,
|
||||
meta->height() / 2.0f,
|
||||
GetRotate() * 180.f
|
||||
)) {
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user