1
This commit is contained in:
parent
911500fced
commit
b7d8632dda
@ -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) {
|
||||
|
@ -32,6 +32,7 @@ public:
|
||||
a8::Vec2 _max;
|
||||
|
||||
AabbCollider() { type = CT_Aabb; };
|
||||
void MoveCenter(float x, float y);
|
||||
};
|
||||
|
||||
class CircleCollider : public ColliderComponent
|
||||
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -268,7 +268,6 @@ message MFPlayerFull
|
||||
|
||||
repeated MFAttrAddition attr_addition= 61; //属性加成
|
||||
|
||||
//一下字段只有僵尸模式才有效
|
||||
optional int32 charid = 44; //人物id
|
||||
optional float speed = 45; //速度
|
||||
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user