Replace Quaternion with glm math (#1868)

This commit is contained in:
David Markowitz
2025-09-06 19:18:03 -07:00
committed by GitHub
parent 8198ad70f6
commit f6c13d9ee6
77 changed files with 197 additions and 406 deletions

View File

@@ -93,7 +93,7 @@ void AmDrawBridge::MoveBridgeDown(Entity* self, Entity* bridge, bool down) {
return;
}
auto forwardVect = simplePhysicsComponent->GetRotation().GetForwardVector();
auto forwardVect = QuatUtils::Forward(simplePhysicsComponent->GetRotation());
auto degrees = down ? 90.0f : -90.0f;

View File

@@ -129,7 +129,7 @@ void AmShieldGenerator::EnemyEnteredShield(Entity* self, Entity* intruder) {
return;
}
auto dir = intruder->GetRotation().GetForwardVector() * -1;
auto dir = QuatUtils::Forward(intruder->GetRotation()) * -1;
dir.y += 15;
dir.x *= 50;
dir.z *= 50;

View File

@@ -187,7 +187,7 @@ void AmShieldGeneratorQuickbuild::EnemyEnteredShield(Entity* self, Entity* intru
return;
}
auto dir = intruder->GetRotation().GetForwardVector() * -1;
auto dir = QuatUtils::Forward(intruder->GetRotation()) * -1;
dir.y += 15;
dir.x *= 50;
dir.z *= 50;

View File

@@ -46,23 +46,23 @@ void AmSkullkinTower::SpawnLegs(Entity* self, const std::string& loc) {
info.rot = newRot;
if (loc == "Right") {
const auto dir = rot.GetForwardVector();
const auto dir = QuatUtils::Forward(rot);
pos.x += dir.x * offset;
pos.z += dir.z * offset;
info.pos = pos;
} else if (loc == "Rear") {
const auto dir = rot.GetRightVector();
const auto dir = QuatUtils::Right(rot);
pos.x += dir.x * offset;
pos.z += dir.z * offset;
info.pos = pos;
} else if (loc == "Left") {
const auto dir = rot.GetForwardVector() * -1;
const auto dir = QuatUtils::Forward(rot) * -1;
pos.x += dir.x * offset;
pos.z += dir.z * offset;
info.pos = pos;
}
info.rot = NiQuaternion::LookAt(info.pos, self->GetPosition());
info.rot = QuatUtils::LookAt(info.pos, self->GetPosition());
auto* entity = Game::entityManager->CreateEntity(info, nullptr, self);