1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Allow setting custom third person front view camera offset (#13686)

Co-authored-by: Muhammad Rifqi Priyo Susanto <muhammadrifqipriyosusanto@gmail.com>
Co-authored-by: SmallJoker <SmallJoker@users.noreply.github.com>
This commit is contained in:
Gregor Parzefall 2023-10-02 13:44:03 +02:00 committed by GitHub
parent 3a4bf14c20
commit 33cc29bbda
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 41 additions and 22 deletions

View file

@ -1981,10 +1981,10 @@ void Server::SendLocalPlayerAnimations(session_t peer_id, v2s32 animation_frames
Send(&pkt);
}
void Server::SendEyeOffset(session_t peer_id, v3f first, v3f third)
void Server::SendEyeOffset(session_t peer_id, v3f first, v3f third, v3f third_front)
{
NetworkPacket pkt(TOCLIENT_EYE_OFFSET, 0, peer_id);
pkt << first << third;
pkt << first << third << third_front;
Send(&pkt);
}
@ -3405,12 +3405,13 @@ void Server::setLocalPlayerAnimations(RemotePlayer *player,
SendLocalPlayerAnimations(player->getPeerId(), animation_frames, frame_speed);
}
void Server::setPlayerEyeOffset(RemotePlayer *player, const v3f &first, const v3f &third)
void Server::setPlayerEyeOffset(RemotePlayer *player, const v3f &first, const v3f &third, const v3f &third_front)
{
sanity_check(player);
player->eye_offset_first = first;
player->eye_offset_third = third;
SendEyeOffset(player->getPeerId(), first, third);
player->eye_offset_third_front = third_front;
SendEyeOffset(player->getPeerId(), first, third, third_front);
}
void Server::setSky(RemotePlayer *player, const SkyboxParams &params)