added choosing spaceship in singleplay

This commit is contained in:
Vlad committed 2026-02-24 20:34:01 +06:00
1 parent ad7294ceea
commit 5216965496
6 files changed
+140 -26

No files matched your search

+20 -18
View File
@@ -4,6 +4,7 @@
#define _USE_MATH_DEFINES
#include <math.h>
#include <iostream>
#include <string>
using std::min;
@@ -29,36 +30,37 @@ constexpr long long CUTOFF_TIME = 5000; //ms
uint32_t fnv1a_hash(const std::string& data);
struct ClientState {
int id = 0;
Eigen::Vector3f position = { 0, 0, 45000.0f };
Eigen::Matrix3f rotation = Eigen::Matrix3f::Identity();
Eigen::Vector3f currentAngularVelocity = Eigen::Vector3f::Zero();
float velocity = 0.0f;
int selectedVelocity = 0;
float discreteMag = 0;
int discreteAngle = -1;
int id = 0;
Eigen::Vector3f position = { 0, 0, 45000.0f };
Eigen::Matrix3f rotation = Eigen::Matrix3f::Identity();
Eigen::Vector3f currentAngularVelocity = Eigen::Vector3f::Zero();
float velocity = 0.0f;
int selectedVelocity = 0;
float discreteMag = 0;
int discreteAngle = -1;
int shipType = 0;
// ??? ??????? ????
std::chrono::system_clock::time_point lastUpdateServerTime;
std::string nickname = "Player";
int shipType = 0;
// ??? ??????? ????
std::chrono::system_clock::time_point lastUpdateServerTime;
void simulate_physics(size_t delta);
void simulate_physics(size_t delta);
void apply_lag_compensation(std::chrono::system_clock::time_point nowTime);
void apply_lag_compensation(std::chrono::system_clock::time_point nowTime);
void handle_full_sync(const std::vector<std::string>& parts, int startFrom);
void handle_full_sync(const std::vector<std::string>& parts, int startFrom);
std::string formPingMessageContent();
std::string formPingMessageContent();
};
struct ClientStateInterval
{
std::vector<ClientState> timedStates;
void add_state(const ClientState& state);
void add_state(const ClientState& state);
bool canFetchClientStateAtTime(std::chrono::system_clock::time_point targetTime) const;
bool canFetchClientStateAtTime(std::chrono::system_clock::time_point targetTime) const;
ClientState fetchClientStateAtTime(std::chrono::system_clock::time_point targetTime) const;
ClientState fetchClientStateAtTime(std::chrono::system_clock::time_point targetTime) const;
};