Added 2 missing methods to Quaternion.

This commit is contained in:
Relintai 2023-05-31 00:19:21 +02:00
parent 94085b8191
commit e681906faa
2 changed files with 13 additions and 2 deletions

View File

@ -84,11 +84,22 @@ pandemonium_real GDAPI pandemonium_quaternion_length(const pandemonium_quaternio
return self->length();
}
void GDAPI pandemonium_quaternion_normalize(pandemonium_quaternion *p_self) {
Quaternion *self = (Quaternion *)p_self;
self->normalize();
}
pandemonium_real GDAPI pandemonium_quaternion_length_squared(const pandemonium_quaternion *p_self) {
const Quaternion *self = (const Quaternion *)p_self;
return self->length_squared();
}
pandemonium_bool GDAPI pandemonium_quaternion_is_equal_approx(const pandemonium_quaternion *p_self, const pandemonium_quaternion *p_quat) {
const Quaternion *self = (const Quaternion *)p_self;
const Quaternion *quat = (const Quaternion *)p_quat;
return self->is_equal_approx(*quat);
}
pandemonium_quaternion GDAPI pandemonium_quaternion_normalized(const pandemonium_quaternion *p_self) {
pandemonium_quaternion dest;
const Quaternion *self = (const Quaternion *)p_self;

View File

@ -71,9 +71,9 @@ pandemonium_real GDAPI pandemonium_quaternion_get_w(const pandemonium_quaternion
void GDAPI pandemonium_quaternion_set_w(pandemonium_quaternion *p_self, const pandemonium_real val);
pandemonium_real GDAPI pandemonium_quaternion_length_squared(const pandemonium_quaternion *p_self);
//bool is_equal_approx(const Quaternion &p_quat) const;
pandemonium_bool GDAPI pandemonium_quaternion_is_equal_approx(const pandemonium_quaternion *p_self, const pandemonium_quaternion *p_quat);
pandemonium_real GDAPI pandemonium_quaternion_length(const pandemonium_quaternion *p_self);
//void normalize();
void GDAPI pandemonium_quaternion_normalize(pandemonium_quaternion *p_self);
pandemonium_quaternion GDAPI pandemonium_quaternion_normalized(const pandemonium_quaternion *p_self);
pandemonium_bool GDAPI pandemonium_quaternion_is_normalized(const pandemonium_quaternion *p_self);