This commit is contained in:
aozhiwei 2019-06-11 11:54:18 +08:00
parent c5ac9753ce
commit 281c3b1fe4

View File

@ -129,7 +129,21 @@ ColliderComponent* Obstacle::GetBoxBound()
void Obstacle::GetAabbBox(AabbCollider& aabb_box)
{
if (self_collider2_) {
aabb_box = *self_collider2_;
return;
}
if (self_collider_) {
aabb_box.active = true;
aabb_box.owner = this;
aabb_box._min.x = -self_collider_->rad;
aabb_box._min.y = -self_collider_->rad;
aabb_box._max.x = self_collider_->rad;
aabb_box._max.y = self_collider_->rad;
return;
}
aabb_box.active = true;
aabb_box.owner = this;
}
void Obstacle::GetCircleBox(CircleCollider& circle_box)