Block placement is now centered around the player

This commit is contained in:
CobaltXII
2019-01-01 21:17:57 -05:00
parent 5cf483d5bf
commit 567c4f647a

View File

@@ -642,9 +642,11 @@ int main(int argc, char** argv)
if ((sdl_mouse_l || sdl_mouse_r) && block_timer == 0)
{
float px = player_x;
float py = player_y;
float pz = player_z;
float px = player_x + player_hitbox.xr / 2.0f;
float py = player_y + 0.2f;
float pz = player_z + player_hitbox.zr / 2.0f;
float ix = -sin(glm::radians(-rot_y_deg));
float iy = -tan(glm::radians(-rot_x_deg));