Added missing methods to Vector2i.

This commit is contained in:
Relintai 2023-05-27 12:08:21 +02:00
parent 8473aa34a0
commit a2018f3225
2 changed files with 17 additions and 2 deletions

View File

@ -195,6 +195,21 @@ pandemonium_vector2i GDAPI pandemonium_vector2i_abs(const pandemonium_vector2i *
*((Vector2i *)&dest) = self->abs();
return dest;
}
pandemonium_vector2i GDAPI pandemonium_vector2i_clamp(const pandemonium_vector2i *p_self, const pandemonium_vector2i *p_min, const pandemonium_vector2i *p_max) {
pandemonium_vector2i dest;
const Vector2i *self = (const Vector2i *)p_self;
const Vector2i *min = (const Vector2i *)p_min;
const Vector2i *max = (const Vector2i *)p_max;
*((Vector2i *)&dest) = self->clamp(*min, *max);
return dest;
}
pandemonium_vector2 GDAPI pandemonium_vector2i_to_vector2(const pandemonium_vector2i *p_self) {
pandemonium_vector2 dest;
const Vector2i *self = (const Vector2i *)p_self;
*((Vector2 *)&dest) = self->to_vector2();
return dest;
}
pandemonium_vector2i GDAPI pandemonium_vector2i_sign(const pandemonium_vector2i *p_self) {
pandemonium_vector2i dest;

View File

@ -104,9 +104,9 @@ pandemonium_int GDAPI pandemonium_vector2i_length_squared(const pandemonium_vect
pandemonium_real GDAPI pandemonium_vector2i_aspect(const pandemonium_vector2i *p_self);
pandemonium_vector2i GDAPI pandemonium_vector2i_sign(const pandemonium_vector2i *p_self);
pandemonium_vector2i GDAPI pandemonium_vector2i_abs(const pandemonium_vector2i *p_self);
//Vector2i clamp(const Vector2i &p_min, const Vector2i &p_max) const;
pandemonium_vector2i GDAPI pandemonium_vector2i_clamp(const pandemonium_vector2i *p_self, const pandemonium_vector2i *p_min, const pandemonium_vector2i *p_max);
//Vector2 to_vector2() const { return Vector2(x, y); }
pandemonium_vector2 GDAPI pandemonium_vector2i_to_vector2(const pandemonium_vector2i *p_self);
pandemonium_string GDAPI pandemonium_vector2i_as_string(const pandemonium_vector2i *p_self);