refactor: allow usage of NiPoint3 and NiQuaternion in constexpr context (#1414)

* allow usage of NiPoint3 and NiQuaternion in constexpr context

* removed .cpp files entirely

* moving circular dependency circumvention stuff to an .inl file

* real world usage!!!!!

* reverting weird branch cross-pollination

* removing more weird branch cross-pollination

* remove comment

* added inverse header guard to inl file

* Update NiPoint3.inl

* trying different constructor syntax

* reorganize into .inl files for readability

* uncomment include

* moved non-constexpr definitions to cpp file

* moved static definitions back to inl files

* testing fix

* moved constants into seperate namespace

* Undo change in build-and-test.yml

* nodiscard
This commit is contained in:
jadebenn
2024-01-29 01:53:12 -06:00
committed by GitHub
parent 2f247b1fc9
commit a0d51e21ca
41 changed files with 509 additions and 533 deletions

View File

@@ -85,7 +85,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 = NiQuaternion::IDENTITY;
NiQuaternion rot = NiQuaternionConstant::IDENTITY;
controllable->SetStatic(false);
@@ -402,7 +402,7 @@ void BossSpiderQueenEnemyServer::OnTimerDone(Entity* self, const std::string tim
const auto withdrawn = self->GetBoolean(u"isWithdrawn");
if (!withdrawn) return;
NiQuaternion rot = NiQuaternion::IDENTITY;
NiQuaternion rot = NiQuaternionConstant::IDENTITY;
//First rotate for anim
controllable->SetStatic(false);
@@ -597,12 +597,12 @@ void BossSpiderQueenEnemyServer::OnUpdate(Entity* self) {
if (!isWithdrawn) return;
if (controllable->GetRotation() == NiQuaternion::IDENTITY) {
if (controllable->GetRotation() == NiQuaternionConstant::IDENTITY) {
return;
}
controllable->SetStatic(false);
controllable->SetRotation(NiQuaternion::IDENTITY);
controllable->SetRotation(NiQuaternionConstant::IDENTITY);
controllable->SetStatic(true);
Game::entityManager->SerializeEntity(self);

View File

@@ -13,7 +13,7 @@ void AgLaserSensorServer::OnStartup(Entity* self) {
phantomPhysicsComponent->SetPhysicsEffectActive(true);
phantomPhysicsComponent->SetEffectType(ePhysicsEffectType::REPULSE);
phantomPhysicsComponent->SetDirectionalMultiplier(repelForce);
phantomPhysicsComponent->SetDirection(NiPoint3::UNIT_Y);
phantomPhysicsComponent->SetDirection(NiPoint3Constant::UNIT_Y);
}

View File

@@ -66,7 +66,7 @@ void AmDrawBridge::OnTimerDone(Entity* self, std::string timerName) {
return;
}
simplePhysicsComponent->SetAngularVelocity(NiPoint3::ZERO);
simplePhysicsComponent->SetAngularVelocity(NiPoint3Constant::ZERO);
Game::entityManager->SerializeEntity(bridge);
}

View File

@@ -81,7 +81,7 @@ void MastTeleport::OnTimerDone(Entity* self, std::string timerName) {
GameMessages::SendOrientToAngle(playerId, true, rads, player->GetSystemAddress());
GameMessages::SendTeleport(playerId, position, NiQuaternion::IDENTITY, player->GetSystemAddress());
GameMessages::SendTeleport(playerId, position, NiQuaternionConstant::IDENTITY, player->GetSystemAddress());
GameMessages::SendSetStunned(playerId, eStateChangeType::POP, player->GetSystemAddress(),
LWOOBJID_EMPTY, true, true, true, true, true, true, true

View File

@@ -40,6 +40,6 @@ void PetFromDigServer::OnNotifyPetTamingMinigame(Entity* self, Entity* tamer, eP
return;
// TODO: Remove custom group?
// Command the pet to the player as it may otherwise go to its spawn point which is non existant
// petComponent->Command(NiPoint3::ZERO, LWOOBJID_EMPTY, 6, 202, true);
// petComponent->Command(NiPoint3Constant::ZERO, LWOOBJID_EMPTY, 6, 202, true);
}
}

View File

@@ -56,7 +56,7 @@ void GfBanana::OnHit(Entity* self, Entity* attacker) {
return;
}
bananaEntity->SetPosition(bananaEntity->GetPosition() - NiPoint3::UNIT_Y * 8);
bananaEntity->SetPosition(bananaEntity->GetPosition() - NiPoint3Constant::UNIT_Y * 8);
auto* bananaDestroyable = bananaEntity->GetComponent<DestroyableComponent>();

View File

@@ -39,6 +39,6 @@ void CrabServer::OnNotifyPetTamingMinigame(Entity* self, Entity* tamer, ePetTami
return;
// TODO: Remove custom group?
// Command the pet to the player as it may otherwise go to its spawn point which is non existant
// petComponent->Command(NiPoint3::ZERO, LWOOBJID_EMPTY, 6, 202, true);
// petComponent->Command(NiPoint3Constant::ZERO, LWOOBJID_EMPTY, 6, 202, true);
}
}