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

@@ -88,7 +88,7 @@ void BossSpiderQueenEnemyServer::WithdrawSpider(Entity* self, const bool withdra
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"SetColGroup", 10, 0, 0, "", UNASSIGNED_SYSTEM_ADDRESS);
//First rotate for anim
NiQuaternion rot = NiQuaternionConstant::IDENTITY;
NiQuaternion rot = QuatUtils::IDENTITY;
controllable->SetStatic(false);
@@ -405,7 +405,7 @@ void BossSpiderQueenEnemyServer::OnTimerDone(Entity* self, const std::string tim
const auto withdrawn = self->GetBoolean(u"isWithdrawn");
if (!withdrawn) return;
NiQuaternion rot = NiQuaternionConstant::IDENTITY;
NiQuaternion rot = QuatUtils::IDENTITY;
//First rotate for anim
controllable->SetStatic(false);
@@ -600,12 +600,12 @@ void BossSpiderQueenEnemyServer::OnUpdate(Entity* self) {
if (!isWithdrawn) return;
if (controllable->GetRotation() == NiQuaternionConstant::IDENTITY) {
if (controllable->GetRotation() == QuatUtils::IDENTITY) {
return;
}
controllable->SetStatic(false);
controllable->SetRotation(NiQuaternionConstant::IDENTITY);
controllable->SetRotation(QuatUtils::IDENTITY);
controllable->SetStatic(true);
Game::entityManager->SerializeEntity(self);

View File

@@ -52,7 +52,7 @@ private:
ControllablePhysicsComponent* controllable = nullptr;
BaseCombatAIComponent* combat = nullptr;
NiQuaternion originRotation;
NiQuaternion originRotation = QuatUtils::IDENTITY;
int m_CurrentBossStage = 0;
int m_DeathCounter = 0;

View File

@@ -76,7 +76,7 @@ void AmDarklingDragon::OnHitOrHealResult(Entity* self, Entity* attacker, int32_t
self->AddTimer("timeToStunLoop", 1.0f);
auto position = self->GetPosition();
auto forward = self->GetRotation().GetForwardVector();
auto forward = QuatUtils::Forward(self->GetRotation());
auto backwards = forward * -1;
forward.x *= 10;

View File

@@ -92,7 +92,7 @@ void FvMaelstromDragon::OnHitOrHealResult(Entity* self, Entity* attacker, int32_
self->AddTimer("timeToStunLoop", 1.0f);
auto position = self->GetPosition();
auto forward = self->GetRotation().GetForwardVector();
auto forward = QuatUtils::Forward(self->GetRotation());
auto backwards = forward * -1;
forward.x *= 10;

View File

@@ -66,7 +66,7 @@ void BaseEnemyApe::OnTimerDone(Entity* self, std::string timerName) {
const auto position = self->GetPosition();
const auto rotation = self->GetRotation();
const auto backwardVector = rotation.GetForwardVector() * -1;
const auto backwardVector = QuatUtils::Forward(rotation) * -1;
const auto objectPosition = NiPoint3(
position.GetX() - (backwardVector.GetX() * 8),
position.GetY(),