Merge branch 'spark'

This commit is contained in:
Vladislav Khorev committed 2026-02-22 13:30:33 +03:00
commit 84d8ee7eee
5 files changed
+6723 -34

No files matched your search

+29 -4
View File
@@ -421,12 +421,27 @@ namespace ZL
//spaceshipBase = LoadFromTextFile02("./resources/spaceship006x.txt", CONST_ZIP_FILE);
//spaceshipBase.RotateByMatrix(Eigen::Quaternionf(Eigen::AngleAxisf(-M_PI / 2.0, Eigen::Vector3f::UnitY())).toRotationMatrix());// QuatFromRotateAroundY(M_PI / 2.0).toRotationMatrix());
spaceshipTexture = std::make_unique<Texture>(CreateTextureDataFromPng("resources/MainCharacter_Base_color_sRGB.png", CONST_ZIP_FILE));
spaceshipBase = LoadFromTextFile02("resources/spaceshipnew001.txt", CONST_ZIP_FILE);
spaceshipBase.RotateByMatrix(Eigen::Quaternionf(Eigen::AngleAxisf(M_PI, Eigen::Vector3f::UnitY())).toRotationMatrix());// QuatFromRotateAroundY(M_PI / 2.0).toRotationMatrix());
spaceshipBase.Move(Vector3f{ 1.2, 0, -5 });
/*
spaceshipTexture = std::make_unique<Texture>(CreateTextureDataFromPng("resources/Cargo_Base_color_sRGB.png", CONST_ZIP_FILE));
spaceshipBase = LoadFromTextFile02("resources/cargoship001.txt", CONST_ZIP_FILE);
auto quat = Eigen::Quaternionf(Eigen::AngleAxisf(-M_PI*0.5, Eigen::Vector3f::UnitZ()));
auto rotMatrix = quat.toRotationMatrix();
spaceshipBase.RotateByMatrix(rotMatrix);
auto quat2 = Eigen::Quaternionf(Eigen::AngleAxisf(M_PI*0.5, Eigen::Vector3f::UnitY()));
auto rotMatrix2 = quat2.toRotationMatrix();
spaceshipBase.RotateByMatrix(rotMatrix2);
//spaceshipBase.RotateByMatrix(Eigen::Quaternionf(Eigen::AngleAxisf(M_PI, Eigen::Vector3f::UnitY())).toRotationMatrix());// QuatFromRotateAroundY(M_PI / 2.0).toRotationMatrix());
*/
spaceship.AssignFrom(spaceshipBase);
spaceship.RefreshVBO();
@@ -808,7 +823,7 @@ namespace ZL
{
if (!textRenderer) return;
#ifdef NETWORK
//#ifdef NETWORK
// 2D поверх 3D
glDisable(GL_DEPTH_TEST);
glEnable(GL_BLEND);
@@ -822,8 +837,9 @@ namespace ZL
for (auto const& [id, remotePlayer] : remotePlayerStates)
{
if (deadRemotePlayers.count(id)) continue;
//<<<<<<< HEAD
//<<<<<<< HEAD
const ClientState& st = remotePlayer;
// Позиция корабля в мире
Vector3f shipWorld = st.position;
@@ -855,7 +871,7 @@ namespace ZL
glDisable(GL_BLEND);
glEnable(GL_DEPTH_TEST);
#endif
//#endif
}
int64_t Game::getSyncTimeMs() {
@@ -1422,8 +1438,17 @@ namespace ZL
#endif
}
render();
if (networkClient) {
#ifndef NETWORK
auto localClient = dynamic_cast<ZL::LocalClient*>(networkClient.get());
if (localClient) {
localClient->setLocalPlayerState(Environment::shipState);
}
#endif
networkClient->Poll();
}
mainThreadHandler.processMainThreadTasks();
networkClient->Poll();
if (networkClient) {
auto pending = networkClient->getPendingProjectiles();