diff options
| author | iamcheeseman <[hidden email]> | 2026-01-17 20:43:31 -0500 |
|---|---|---|
| committer | iamcheeseman <[hidden email]> | 2026-01-17 20:43:31 -0500 |
| commit | dbe4c645e08fccb89f7bc1988f7be5c2ea246b31 (patch) | |
| tree | 9aed80632dacab389d5e1887b289d1834c184cc7 /src/verlet.odin | |
| parent | a48cdcab8a483ac9c8524cc7fd1613f0d90cf4d4 (diff) | |
player now only applies a force to verlet
Diffstat (limited to 'src/verlet.odin')
| -rw-r--r-- | src/verlet.odin | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/verlet.odin b/src/verlet.odin index 239e1b6..7373630 100644 --- a/src/verlet.odin +++ b/src/verlet.odin @@ -7,7 +7,7 @@ import rl "vendor:raylib" import "phys" -VERLET_STEPS :: 50 +VERLET_STEPS :: 8 VERLET_MIN_DIST_TO_PLAYER :: 8 Verlet_Node :: struct { @@ -43,7 +43,8 @@ update_verlet_node :: proc(node: ^Verlet_Node) { player_dist := linalg.distance(node.pos, player_pos) if player_dist < VERLET_MIN_DIST_TO_PLAYER { dir := linalg.normalize(node.pos - player_pos) - node.pos = player_pos + dir * VERLET_MIN_DIST_TO_PLAYER + node.accel += dir * 1000 + // node.pos = player_pos + dir * VERLET_MIN_DIST_TO_PLAYER } prev_pos := node.pos |
