diff options
author | reduz <reduzio@gmail.com> | 2020-10-07 21:29:49 -0300 |
---|---|---|
committer | reduz <reduzio@gmail.com> | 2020-10-09 13:25:47 -0300 |
commit | 26f5bd245c535fec5bfdd51a0f939d0a51179d85 (patch) | |
tree | 7d20274c657c5f154186b690c1c0a67ca0174a9f /core/math | |
parent | c35005ba25473ea8fa48aadbd1687984c76457cf (diff) |
Implement GPU Particle Collisions
-Sphere Attractor
-Box Attractor
-Vector Field
-Sphere Collider
-Box Collider
-Baked SDF Collider
-Heightmap Collider
Diffstat (limited to 'core/math')
-rw-r--r-- | core/math/vector2.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/core/math/vector2.h b/core/math/vector2.h index f41bcc15bc..c2a2656e72 100644 --- a/core/math/vector2.h +++ b/core/math/vector2.h @@ -65,6 +65,14 @@ struct Vector2 { real_t length() const; real_t length_squared() const; + Vector2 min(const Vector2 &p_vector2) const { + return Vector2(MIN(x, p_vector2.x), MIN(y, p_vector2.y)); + } + + Vector2 max(const Vector2 &p_vector2) const { + return Vector2(MAX(x, p_vector2.x), MAX(y, p_vector2.y)); + } + real_t distance_to(const Vector2 &p_vector2) const; real_t distance_squared_to(const Vector2 &p_vector2) const; real_t angle_to(const Vector2 &p_vector2) const; |