Skip to content

Commit

Permalink
Very important line reordering
Browse files Browse the repository at this point in the history
  • Loading branch information
grorp committed Dec 16, 2024
1 parent 8ba8dd2 commit 08fd9d4
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/script/lua_api/l_object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1265,15 +1265,14 @@ int ObjectRef::l_get_point_dir(lua_State *L)
if (playersao == nullptr)
return 0;

RemotePlayer *player = playersao->getPlayer();

// "-1 * yaw" because that's how the yaw value is applied to the camera,
// no idea why it was chosen to be like that.
core::quaternion look_rot(v3f(playersao->getRadLookPitch(),
-1.0f * playersao->getRadRotation().Y, 0.0f));
core::matrix4 mat;
look_rot.getMatrixFast(mat);

RemotePlayer *player = playersao->getPlayer();
v3f point_rot_rel = v3f(player->point_pitch, player->point_yaw, 0.0f);

const v3f point_dir_rel = point_rot_rel.rotationToDirection();
Expand Down

0 comments on commit 08fd9d4

Please sign in to comment.