Skip to content

Commit

Permalink
use predicted player origin for attached lights (fix lag)
Browse files Browse the repository at this point in the history
  • Loading branch information
xoxor4d committed Feb 3, 2024
1 parent 917d287 commit fa32df0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/modules/rtx/rtx_lights.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ namespace components
game::vec3_t fwd, rt, up = {};
utils::vector::angle_vectors(game::cgs->predictedPlayerState.viewangles, fwd, rt, up);

setting->origin[0] = game::glob::lpmove_camera_origin.x + (utils::vector::dot3(fwd, setting->dir_offset));
setting->origin[1] = game::glob::lpmove_camera_origin.y + (utils::vector::dot3(rt, setting->dir_offset));
setting->origin[2] = game::glob::lpmove_camera_origin.z + (utils::vector::dot3(up, setting->dir_offset));
setting->origin[0] = game::cgs->predictedPlayerState.origin[0] + (utils::vector::dot3(fwd, setting->dir_offset));
setting->origin[1] = game::cgs->predictedPlayerState.origin[1] + (utils::vector::dot3(rt, setting->dir_offset));
setting->origin[2] = game::cgs->predictedPlayerState.origin[2] + game::cgs->predictedPlayerState.viewHeightCurrent + (utils::vector::dot3(up, setting->dir_offset));

utils::vector::copy(setting->origin, &ff_light->Position.x, 3);

Expand Down

0 comments on commit fa32df0

Please sign in to comment.