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