mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-06 11:31:49 +00:00
feat: players interpolation & add hud.set_allow_pause(...)
This commit is contained in:
parent
036e13a2ca
commit
2fa71b3bf0
25 changed files with 232 additions and 41 deletions
|
|
@ -7,6 +7,7 @@
|
|||
#include "interfaces/Serializable.hpp"
|
||||
#include "settings.hpp"
|
||||
#include "voxels/voxel.hpp"
|
||||
#include "util/Interpolation.hpp"
|
||||
|
||||
class Chunks;
|
||||
class Camera;
|
||||
|
|
@ -55,11 +56,15 @@ class Player : public Serializable {
|
|||
bool loadingChunks = true;
|
||||
entityid_t eid;
|
||||
entityid_t selectedEid = 0;
|
||||
|
||||
glm::vec3 rotation {};
|
||||
public:
|
||||
util::VecInterpolation<3, float, true> rotationInterpolation {true};
|
||||
|
||||
std::unique_ptr<Chunks> chunks;
|
||||
std::shared_ptr<Camera> fpCamera, spCamera, tpCamera;
|
||||
std::shared_ptr<Camera> currentCamera;
|
||||
glm::vec3 rotation {};
|
||||
|
||||
CursorSelection selection {};
|
||||
|
||||
Player(
|
||||
|
|
@ -123,6 +128,9 @@ public:
|
|||
void setSpawnPoint(glm::vec3 point);
|
||||
glm::vec3 getSpawnPoint() const;
|
||||
|
||||
glm::vec3 getRotation(bool interpolated=false) const;
|
||||
void setRotation(const glm::vec3& rotation);
|
||||
|
||||
dv::value serialize() const override;
|
||||
void deserialize(const dv::value& src) override;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue