Commit Graph

141 Commits (20ca626acfe4ba6fd614d7e6b25381aea25d645a)

Author SHA1 Message Date
Sara 20ca626acf solve_collision_slide no longer modifies rhs argument 2023-06-25 18:18:07 +02:00
Sara 9a732ad82f simplified solve_collision_slide 2023-06-25 18:13:48 +02:00
Sara 812e7eab20 renamed move_and_slide to physics_move 2023-06-25 18:13:28 +02:00
Sara ead22d114c added explicit extern specifiers to physics functions lacking them 2023-06-25 18:13:12 +02:00
Sara 7a2cb3cd5c added solver field to physics_t, exposed solve_collision_slide to make it work 2023-06-25 18:12:38 +02:00
Sara 76bf6e81e5 reworked collision_t component into physics_t component 2023-06-25 12:41:53 +02:00
Sara 8a028dca08 Merge pull request 'improved handling of interpolate_move calls with a distance shorter than minimum delta' (#10) from improve-short-moves into main
Reviewed-on: #10
2023-06-24 20:44:49 +00:00
Sara 4acc18a101 Merge branch 'main' into improve-short-moves 2023-06-24 20:44:43 +00:00
Sara a9ba15f93b improved handling of interpolate_move calls with a distance shorter than minimum delta 2023-06-24 22:42:38 +02:00
Sara 78d1e78dd7 Merge pull request 'split-world-module' (#9) from split-world-module into main
Reviewed-on: #9
2023-06-24 20:09:34 +00:00
Sara aa9dfa3fcd Merge branch 'main' into split-world-module 2023-06-24 20:09:04 +00:00
Sara bf21a388ab Merge pull request 'Add a move_and_slide style interpolation option' (#7) from move-and-slide into main
Reviewed-on: #7
2023-06-24 20:08:56 +00:00
Sara b8c856bf56 split the world module into world, physics, and object 2023-06-24 22:03:28 +02:00
Sara 43fa322409 removed debug prints from _slide_collision solver 2023-06-24 20:34:35 +02:00
Sara 4271ee8f8d fully implemented slide collision for any combination of aabb and circle colliders 2023-06-24 20:32:54 +02:00
Sara daa53c6ef0 movetowards now also works in cases where x == 0 && y != 0 || x != 0 && y == 0 2023-06-24 20:32:31 +02:00
Sara 3df374b3b9 interpolate move will now immediately stop if destination is reached 2023-06-18 22:45:06 +02:00
Sara fd99159b27 Merge pull request 'fix event based axis input giving results that are not in range -1 to 1' (#8) from event-input into move-and-slide
Reviewed-on: #8
2023-06-18 20:24:31 +00:00
Sara fab7338891 axis now keeps a history for both keys 2023-06-18 22:22:16 +02:00
Sara cfcd31cee8 more explicit typing and casting in timespec_to_sec 2023-06-18 22:17:38 +02:00
Sara fc1f3499e3 input events are now still pumped during frame downtime 2023-06-18 22:17:25 +02:00
Sara 14b8b2f380 delta time is now updated before evaluating minimum delta time/ 2023-06-18 22:17:06 +02:00
Sara a93d09c96c reworked most input listener types to use OS events instead of checking state on update
this allows for them to be more reliable with low framerates
2023-06-18 22:14:16 +02:00
Sara b30df338ac no longer zeroing _delta_time if nanosecond element of difference between last and next time is negative 2023-06-18 19:04:22 +02:00
Sara a49ac0db93 timespec_to_sec now first multiplies tv_nsec by 1E-09 to convert to seconds 2023-06-18 18:04:49 +02:00
Sara 56679110e3 added frame limiting 2023-06-18 18:02:22 +02:00
Sara d69b92a464 delta_time is now calculating by converting timespec to seconds 2023-06-18 17:59:50 +02:00
Sara fcb9645dbe added NORMALIZE #define macro
avoids pointers and the accompanying dereference operations of normalize(...)
2023-06-18 16:34:28 +02:00
Sara 6f78731d8f normalize will now normalize if either x or y is non-zero
previously 100,0 would return 100,0 instead of 1,0
2023-06-18 16:33:39 +02:00
Sara 494dbfedb3 clamp_magnitude no longer outputs input x,y regardless of checks 2023-06-18 16:14:30 +02:00
Sara 1df623e669 move_towards now compares absolutes of diff and dir to check if the destination will be reached 2023-06-18 16:09:43 +02:00
Sara fa2a911732 added corelib/math/vec.h single header vector math library 2023-06-18 14:39:04 +02:00
Sara ea3beddfec inverted correction collision_check 2023-06-18 14:27:24 +02:00
Sara dff8e8304d iteration count for interpolate_move now based on number of steps required to fullfill move in theory 2023-06-18 14:24:38 +02:00
Sara 0a8aac2325 implemented slide 2023-06-18 14:18:37 +02:00
Sara 81e242532b added argument to interpolate_move, removed return value from interpolate_move 2023-06-18 14:08:55 +02:00
Sara 96eeb3233f Merge pull request 'implement basic collision and interpolation' (#6) from collision into main
Reviewed-on: #6
2023-06-18 11:51:15 +00:00
Sara bd87bcf8af bbminy in _collision_circle_aabb is now calculated correctly using y 2023-06-18 13:45:53 +02:00
Sara d134df5847 position now resets to last when interpolate_move collides 2023-06-18 13:42:20 +02:00
Sara 4bf759d224 added broadcast collision 2023-06-18 13:22:35 +02:00
Sara e32eb731c2 simplified interpolate move comparison condition 2023-06-18 13:15:03 +02:00
Sara 0b32967c20 removed requirement for a evt_collision listener from _can_collide 2023-06-18 13:13:35 +02:00
Sara 8ae7d302fe inverted _can_collide guard clause in interpolate_move 2023-06-18 11:59:13 +02:00
Sara f8d69e3537 reversed order of operations in interpolate_move 2023-06-18 11:39:16 +02:00
Sara 1748db8412 Merge pull request 'Correctly render sprites' (#5) from fix-render into main
Reviewed-on: #5
2023-06-18 09:24:13 +00:00
Sara d067ea6df8 default sprite origin in is now 0,0 2023-06-16 13:35:33 +02:00
Sara 0a6242ef3c sprite origin is now applied to untransformed rect 2023-06-14 18:50:55 +02:00
Sara a0cc95873e added .helix dir to ignore 2023-06-14 18:50:00 +02:00
Sara eb39cb1432 added .nvimrc to gitignore 2023-06-05 18:11:31 +02:00
Sara 17eef0eb20 added interpolate move 2023-05-28 23:59:24 +02:00