mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-10-11 01:48:07 +00:00
Replace Quaternion with glm math (#1868)
This commit is contained in:
@@ -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;
|
||||
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
|
@@ -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);
|
||||
|
||||
|
Reference in New Issue
Block a user