]> git.lizzy.rs Git - dragonblocks_alpha.git/commitdiff
Use minecraft constants for physics
authorElias Fleckenstein <eliasfleckenstein@web.de>
Mon, 12 Jul 2021 09:18:59 +0000 (11:18 +0200)
committerElias Fleckenstein <eliasfleckenstein@web.de>
Mon, 12 Jul 2021 09:18:59 +0000 (11:18 +0200)
src/clientplayer.c
src/input.c

index a6259a62f3dfff1bc5bbf913c30bcfd0d5a8f07c..98dddb4f2cbbb9676d8aeb01b9d13f40adcc38e2 100644 (file)
@@ -89,7 +89,7 @@ static bool can_jump(ClientPlayer *player)
 void clientplayer_jump(ClientPlayer *player)
 {
        if (can_jump(player))
-               player->velocity.y += 6.5f;
+               player->velocity.y += 10.0f;
 }
 
 void clientplayer_tick(ClientPlayer *player, f64 dtime)
@@ -97,7 +97,7 @@ void clientplayer_tick(ClientPlayer *player, f64 dtime)
        v3f old_pos = player->pos;
        v3f old_velocity = player->velocity;
 
-       player->velocity.y -= 9.81f * dtime;
+       player->velocity.y -= 32.0f * dtime;
 
 #define GETS(vec, comp) *(s32 *) ((char *) &vec + offsetof(v3s32, comp))
 #define GETF(vec, comp) *(f32 *) ((char *) &vec + offsetof(v3f32, comp))
index 52f6d1d6725f82281ae43b65647f644b60f9ad96..19f8473af32ba53421b73f57d330465902b1bf11 100644 (file)
@@ -29,7 +29,7 @@ static void cursor_pos_callback(__attribute__((unused)) GLFWwindow* window, doub
 static bool move(int forward, int backward, vec3 dir)
 {
        f32 sign;
-       f32 speed = 4.0f;
+       f32 speed = 4.317f;
 
        if (glfwGetKey(input.window, forward) == GLFW_PRESS)
                sign = +1.0f;