fix renderHands with third person cameras

This commit is contained in:
MihailRis
2024-10-31 21:27:30 +03:00
parent 2c16f986e1
commit e217476e84
7 changed files with 25 additions and 23 deletions
+3 -3
View File
@@ -41,7 +41,7 @@ CameraControl::CameraControl(
const std::shared_ptr<Player>& player, const CameraSettings& settings
)
: player(player),
camera(player->camera),
camera(player->fpCamera),
settings(settings),
offset(0.0f, 0.7f, 0.0f) {
}
@@ -353,7 +353,7 @@ static void pick_block(
voxel* PlayerController::updateSelection(float maxDistance) {
auto indices = level->content->getIndices();
auto chunks = level->chunks.get();
auto camera = player->camera.get();
auto camera = player->fpCamera.get();
auto& selection = player->selection;
glm::vec3 end;
@@ -416,7 +416,7 @@ voxel* PlayerController::updateSelection(float maxDistance) {
void PlayerController::processRightClick(const Block& def, const Block& target) {
const auto& selection = player->selection;
auto chunks = level->chunks.get();
auto camera = player->camera.get();
auto camera = player->fpCamera.get();
blockstate state {};
state.rotation = determine_rotation(&def, selection.normal, camera->dir);