diff options
| author | LLLL Colonq <llll@colonq> | 2026-07-31 05:00:49 -0400 |
|---|---|---|
| committer | LLLL Colonq <llll@colonq> | 2026-07-31 05:00:49 -0400 |
| commit | ea5332e4a1a035e888709bee278fcafb182f7922 (patch) | |
| tree | 7e1520391e7f04fa3df425fd9ed02008f748cdfd /2026/games_submissions/asrael_io/source/src/math.rs | |
| parent | 3ec03ba57474aa4320cb7901980b55706adbc111 (diff) | |
Update
Diffstat (limited to '2026/games_submissions/asrael_io/source/src/math.rs')
| -rw-r--r-- | 2026/games_submissions/asrael_io/source/src/math.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/2026/games_submissions/asrael_io/source/src/math.rs b/2026/games_submissions/asrael_io/source/src/math.rs new file mode 100644 index 0000000..371f165 --- /dev/null +++ b/2026/games_submissions/asrael_io/source/src/math.rs @@ -0,0 +1,13 @@ +use glam::Vec2; + +pub fn aabb(a_pos: Vec2, a_size: Vec2, b_pos: Vec2, b_size: Vec2) -> bool { + a_pos.x < b_pos.x + b_size.x + && b_pos.x < a_pos.x + a_size.x + && a_pos.y < b_pos.y + b_size.y + && b_pos.y < a_pos.y + a_size.y +} + +pub fn bezier(p: [Vec2; 4], t: f32) -> Vec2 { + let u = 1.0 - t; + u * u * u * p[0] + 3.0 * u * u * t * p[1] + 3.0 * u * t * t * p[2] + t * t * t * p[3] +} |
