mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 02:51:49 +00:00
added player camera rotation z axis
This commit is contained in:
parent
1917cbba8b
commit
0eba793d63
4 changed files with 23 additions and 10 deletions
|
|
@ -206,6 +206,7 @@ std::unique_ptr<dynamic::Map> Player::serialize() const {
|
|||
auto& rotarr = root->putList("rotation");
|
||||
rotarr.put(cam.x);
|
||||
rotarr.put(cam.y);
|
||||
rotarr.put(cam.z);
|
||||
|
||||
auto& sparr = root->putList("spawnpoint");
|
||||
sparr.put(spawnpoint.x);
|
||||
|
|
@ -230,6 +231,9 @@ void Player::deserialize(dynamic::Map *src) {
|
|||
auto rotarr = src->list("rotation");
|
||||
cam.x = rotarr->num(0);
|
||||
cam.y = rotarr->num(1);
|
||||
if (rotarr->size() > 2) {
|
||||
cam.z = rotarr->num(2);
|
||||
}
|
||||
|
||||
if (src->has("spawnpoint")) {
|
||||
auto sparr = src->list("spawnpoint");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue