This commit is contained in:
aozhiwei 2021-07-13 06:20:01 +00:00
parent 911500fced
commit b7d8632dda
5 changed files with 20 additions and 4 deletions

View File

@ -304,6 +304,14 @@ bool ColliderComponent::CalcSafePointEx(const a8::Vec2& a_pos, ColliderComponent
return false;
}
void AabbCollider::MoveCenter(float x, float y)
{
_min.x += x;
_min.y += y;
_max.x += x;
_max.y += y;
}
void DestoryCollider(ColliderComponent* collider)
{
switch (collider->type) {

View File

@ -32,6 +32,7 @@ public:
a8::Vec2 _max;
AabbCollider() { type = CT_Aabb; };
void MoveCenter(float x, float y);
};
class CircleCollider : public ColliderComponent

View File

@ -258,9 +258,7 @@ void Human::FillMFObjectFull(Room* room, Human* hum, cs::MFObjectFull* full_data
p->set_revive_countdown(countdown);
}
}
if (room->GetRoomMode() == kZombieMode) {
p->set_charid(meta->i->id());
}
p->set_charid(meta->i->id());
if (GetCar()) {
p->set_car_uniid(GetCar()->car_uniid);
p->set_car_seat(GetSeat());
@ -357,11 +355,14 @@ void Human::GetAabbBox(AabbCollider& aabb_box)
aabb_box._min.y = -GetCar()->meta->i->rad();
aabb_box._max.x = GetCar()->meta->i->rad();
aabb_box._max.y = GetCar()->meta->i->rad();
aabb_box.MoveCenter(GetCar()->hero_meta_->i->move_offset_x(),
GetCar()->hero_meta_->i->move_offset_y());
} else {
aabb_box._min.x = -meta->i->radius();
aabb_box._min.y = -meta->i->radius();
aabb_box._max.x = meta->i->radius();
aabb_box._max.y = meta->i->radius();
aabb_box.MoveCenter(meta->i->hit_offset_x(), meta->i->hit_offset_y());
}
}
@ -3353,11 +3354,14 @@ void Human::GetHitAabbBox(AabbCollider& aabb_box)
aabb_box._min.y = -GetCar()->meta->i->rad();
aabb_box._max.x = GetCar()->meta->i->rad();
aabb_box._max.y = GetCar()->meta->i->rad();
aabb_box.MoveCenter(GetCar()->hero_meta_->i->move_offset_x(),
GetCar()->hero_meta_->i->move_offset_y());
} else {
aabb_box._min.x = -GetHitRadius();
aabb_box._min.y = -GetHitRadius();
aabb_box._max.x = GetHitRadius();
aabb_box._max.y = GetHitRadius();
aabb_box.MoveCenter(meta->i->hit_offset_x(), meta->i->hit_offset_y());
}
}

View File

@ -268,7 +268,6 @@ message MFPlayerFull
repeated MFAttrAddition attr_addition= 61; //
//
optional int32 charid = 44; //id
optional float speed = 45; //

View File

@ -152,6 +152,8 @@ message EquipUpgrade
message Player
{
optional int32 id = 1; //id
optional float move_offset_x = 40;
optional float move_offset_y = 41;
optional float radius = 2; //
optional int32 health = 3; //
optional int32 move_speed = 4; //
@ -175,6 +177,8 @@ message Player
optional int32 revive_time = 22;
optional string name = 23;
optional int32 normal_skill = 24;
optional float hit_offset_x = 42;
optional float hit_offset_y = 43;
optional float hit_radius = 25;
optional string ai_script = 26;
optional string init_buffs = 27;