This commit is contained in:
aozhiwei 2022-10-10 16:52:29 +08:00
parent 337d2e4395
commit 0fae7e9da2

View File

@ -220,12 +220,21 @@ static void CalcGunMuzzlePosition(Creature* c,
}//end if }//end if
if (weapon_meta->gun_muzzle_position) { if (weapon_meta->gun_muzzle_position) {
gun_muzzle_position += gun_muzzle_position +=
#if 1
glm::vec4(
-std::get<0>(*weapon_meta->gun_muzzle_position.get()),
std::get<1>(*weapon_meta->gun_muzzle_position.get()),
std::get<2>(*weapon_meta->gun_muzzle_position.get()),
0
);
#else
glm::vec4( glm::vec4(
std::get<0>(*weapon_meta->gun_muzzle_position.get()), std::get<0>(*weapon_meta->gun_muzzle_position.get()),
std::get<1>(*weapon_meta->gun_muzzle_position.get()), std::get<1>(*weapon_meta->gun_muzzle_position.get()),
std::get<2>(*weapon_meta->gun_muzzle_position.get()), std::get<2>(*weapon_meta->gun_muzzle_position.get()),
0 0
); );
#endif
} }
#if 0 #if 0
if (weapon_meta->movex_position) { if (weapon_meta->movex_position) {
@ -345,6 +354,13 @@ void InternalShot(Creature* c,
auto transform = glm::rotate(hero_transform, auto transform = glm::rotate(hero_transform,
bullet_born_angle * A8_PI, bullet_born_angle * A8_PI,
glm::vec3(0.0, 1.0, 0.0)); glm::vec3(0.0, 1.0, 0.0));
#if 1
if (c->IsCar()) {
transform = glm::rotate(hero_transform,
0 * A8_PI,
glm::vec3(0.0, 1.0, 0.0));
}
#endif
glm::vec4 gun_muzzle_position(0.0, 0.0, 0.0, 0.0); glm::vec4 gun_muzzle_position(0.0, 0.0, 0.0, 0.0);
CalcGunMuzzlePosition(c, weapon_meta, shot_animi, gun_muzzle_position, bulletIdx, bulletNum); CalcGunMuzzlePosition(c, weapon_meta, shot_animi, gun_muzzle_position, bulletIdx, bulletNum);
glm::vec4 v = transform * gun_muzzle_position; glm::vec4 v = transform * gun_muzzle_position;