This commit is contained in:
aozhiwei 2023-11-28 13:49:03 +08:00
parent eb7c559e5c
commit e19e1bf5be

View File

@ -385,11 +385,6 @@ void InternalShot(Creature* c,
long long weapon_uniid,
int trace_target_uniid)
{
#if 0
if (c->IsPlayer()) {
c->SetAttackDir(GlmHelper::UP);
}
#endif
if (weapon_meta->_inventory_slot() == IS_TRAP ||
weapon_meta->_inventory_slot() == IS_MINE) {
ProcMissile(c, weapon_meta, bullet_meta, skill_meta, fly_distance, weapon_uniid, trace_target_uniid);
@ -503,7 +498,6 @@ void InternalShot(Creature* c,
bool is_player = c->IsPlayer();
bool is_car = c->IsCar();
float bullet_born_angle = GlmHelper::CalcAngle(c->GetAttackDir(), GlmHelper::UP);
//if (c->GetAttackDir().z > 0.00001f) {
if (c->GetAttackDir().x < 0.00001f) {
bullet_born_angle = -bullet_born_angle;
}
@ -511,12 +505,11 @@ void InternalShot(Creature* c,
//GlmHelper::RotateY(bullet_born_offset, bullet_born_angle);
auto transform = glm::rotate(hero_transform,
//bullet_born_angle * A8_PI,
glm::radians(bullet_born_angle * 180.0f),
glm::vec3(0.0, 1.0, 0.0));
glm::vec4 gun_muzzle_position(0.0, 0.0, 0.0, 0.0);
CalcGunMuzzlePosition(c, weapon_lv, weapon_meta, shot_animi, gun_muzzle_position, bulletIdx, bulletNum);
#ifdef MYDEBUG0
#ifdef MYDEBUG
gun_muzzle_position +=
glm::vec4(
bullet_born_offset.x / 10.0f,
@ -526,7 +519,6 @@ void InternalShot(Creature* c,
);
#endif
glm::vec4 v = transform * gun_muzzle_position;
//bullet_born_offset = glm::vec3(v.z *10*1, v.y, v.x*10*-1);
bullet_born_offset = glm::vec3(v.x *10*1, v.y, v.z*10*1);
bullet_born_pos = c->GetPos().ToGlmVec3() + bullet_born_offset;
if (c->IsPlayer() || c->IsCar()) {