Mass rename quat to quaternion.

This commit is contained in:
Relintai 2023-05-25 20:26:36 +02:00
parent bc25bde5b4
commit 92bbcd20c2
12 changed files with 7027 additions and 7047 deletions

View File

@ -115,17 +115,17 @@ godot_vector3 GDAPI godot_basis_get_scale(const godot_basis *p_self) {
return dest; return dest;
} }
godot_quat GDAPI godot_basis_get_quat(const godot_basis *p_self) { godot_quaternion GDAPI godot_basis_get_quaternion(const godot_basis *p_self) {
godot_quat dest; godot_quaternion dest;
const Basis *self = (const Basis *)p_self; const Basis *self = (const Basis *)p_self;
*((Quat *)&dest) = self->get_quat(); *((Quaternion *)&dest) = self->get_quaternion();
return dest; return dest;
} }
void GDAPI godot_basis_set_quat(godot_basis *p_self, const godot_quat *p_quat) { void GDAPI godot_basis_set_quaternion(godot_basis *p_self, const godot_quaternion *p_quaternion) {
Basis *self = (Basis *)p_self; Basis *self = (Basis *)p_self;
const Quat *quat = (const Quat *)p_quat; const Quaternion *quaternion = (const Quaternion *)p_quaternion;
self->set_quat(*quat); self->set_quaternion(*quaternion);
} }
void GDAPI godot_basis_set_axis_angle_scale(godot_basis *p_self, const godot_vector3 *p_axis, godot_real p_phi, const godot_vector3 *p_scale) { void GDAPI godot_basis_set_axis_angle_scale(godot_basis *p_self, const godot_vector3 *p_axis, godot_real p_phi, const godot_vector3 *p_scale) {
@ -142,11 +142,11 @@ void GDAPI godot_basis_set_euler_scale(godot_basis *p_self, const godot_vector3
self->set_euler_scale(*euler, *scale); self->set_euler_scale(*euler, *scale);
} }
void GDAPI godot_basis_set_quat_scale(godot_basis *p_self, const godot_quat *p_quat, const godot_vector3 *p_scale) { void GDAPI godot_basis_set_quaternion_scale(godot_basis *p_self, const godot_quaternion *p_quaternion, const godot_vector3 *p_scale) {
Basis *self = (Basis *)p_self; Basis *self = (Basis *)p_self;
const Quat *quat = (const Quat *)p_quat; const Quaternion *quaternion = (const Quaternion *)p_quaternion;
const Vector3 *scale = (const Vector3 *)p_scale; const Vector3 *scale = (const Vector3 *)p_scale;
self->set_quat_scale(*quat, *scale); self->set_quaternion_scale(*quaternion, *scale);
} }
godot_vector3 GDAPI godot_basis_get_euler(const godot_basis *p_self) { godot_vector3 GDAPI godot_basis_get_euler(const godot_basis *p_self) {
@ -200,9 +200,9 @@ void GDAPI godot_basis_new(godot_basis *r_dest) {
*dest = Basis(); *dest = Basis();
} }
void GDAPI godot_basis_new_with_euler_quat(godot_basis *r_dest, const godot_quat *p_euler) { void GDAPI godot_basis_new_with_euler_quaternion(godot_basis *r_dest, const godot_quaternion *p_euler) {
Basis *dest = (Basis *)r_dest; Basis *dest = (Basis *)r_dest;
const Quat *euler = (const Quat *)p_euler; const Quaternion *euler = (const Quaternion *)p_euler;
*dest = Basis(*euler); *dest = Basis(*euler);
} }

View File

@ -1,5 +1,5 @@
/**************************************************************************/ /**************************************************************************/
/* quat.cpp */ /* quaternion.cpp */
/**************************************************************************/ /**************************************************************************/
/* This file is part of: */ /* This file is part of: */
/* GODOT ENGINE */ /* GODOT ENGINE */
@ -28,206 +28,206 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/ /**************************************************************************/
#include "gdnative/quat.h" #include "gdnative/quaternion.h"
#include "core/math/quat.h" #include "core/math/quaternion.h"
#include "core/variant/variant.h" #include "core/variant/variant.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
static_assert(sizeof(godot_quat) == sizeof(Quat), "Quat size mismatch"); static_assert(sizeof(godot_quaternion) == sizeof(Quaternion), "Quaternion size mismatch");
void GDAPI godot_quat_new(godot_quat *r_dest, const godot_real p_x, const godot_real p_y, const godot_real p_z, const godot_real p_w) { void GDAPI godot_quaternion_new(godot_quaternion *r_dest, const godot_real p_x, const godot_real p_y, const godot_real p_z, const godot_real p_w) {
Quat *dest = (Quat *)r_dest; Quaternion *dest = (Quaternion *)r_dest;
*dest = Quat(p_x, p_y, p_z, p_w); *dest = Quaternion(p_x, p_y, p_z, p_w);
} }
void GDAPI godot_quat_new_with_axis_angle(godot_quat *r_dest, const godot_vector3 *p_axis, const godot_real p_angle) { void GDAPI godot_quaternion_new_with_axis_angle(godot_quaternion *r_dest, const godot_vector3 *p_axis, const godot_real p_angle) {
const Vector3 *axis = (const Vector3 *)p_axis; const Vector3 *axis = (const Vector3 *)p_axis;
Quat *dest = (Quat *)r_dest; Quaternion *dest = (Quaternion *)r_dest;
*dest = Quat(*axis, p_angle); *dest = Quaternion(*axis, p_angle);
} }
void GDAPI godot_quat_new_with_basis(godot_quat *r_dest, const godot_basis *p_basis) { void GDAPI godot_quaternion_new_with_basis(godot_quaternion *r_dest, const godot_basis *p_basis) {
const Basis *basis = (const Basis *)p_basis; const Basis *basis = (const Basis *)p_basis;
Quat *dest = (Quat *)r_dest; Quaternion *dest = (Quaternion *)r_dest;
*dest = Quat(*basis); *dest = Quaternion(*basis);
} }
void GDAPI godot_quat_new_with_euler(godot_quat *r_dest, const godot_vector3 *p_euler) { void GDAPI godot_quaternion_new_with_euler(godot_quaternion *r_dest, const godot_vector3 *p_euler) {
const Vector3 *euler = (const Vector3 *)p_euler; const Vector3 *euler = (const Vector3 *)p_euler;
Quat *dest = (Quat *)r_dest; Quaternion *dest = (Quaternion *)r_dest;
*dest = Quat(*euler); *dest = Quaternion(*euler);
} }
godot_real GDAPI godot_quat_get_x(const godot_quat *p_self) { godot_real GDAPI godot_quaternion_get_x(const godot_quaternion *p_self) {
const Quat *self = (const Quat *)p_self; const Quaternion *self = (const Quaternion *)p_self;
return self->x; return self->x;
} }
void GDAPI godot_quat_set_x(godot_quat *p_self, const godot_real val) { void GDAPI godot_quaternion_set_x(godot_quaternion *p_self, const godot_real val) {
Quat *self = (Quat *)p_self; Quaternion *self = (Quaternion *)p_self;
self->x = val; self->x = val;
} }
godot_real GDAPI godot_quat_get_y(const godot_quat *p_self) { godot_real GDAPI godot_quaternion_get_y(const godot_quaternion *p_self) {
const Quat *self = (const Quat *)p_self; const Quaternion *self = (const Quaternion *)p_self;
return self->y; return self->y;
} }
void GDAPI godot_quat_set_y(godot_quat *p_self, const godot_real val) { void GDAPI godot_quaternion_set_y(godot_quaternion *p_self, const godot_real val) {
Quat *self = (Quat *)p_self; Quaternion *self = (Quaternion *)p_self;
self->y = val; self->y = val;
} }
godot_real GDAPI godot_quat_get_z(const godot_quat *p_self) { godot_real GDAPI godot_quaternion_get_z(const godot_quaternion *p_self) {
const Quat *self = (const Quat *)p_self; const Quaternion *self = (const Quaternion *)p_self;
return self->z; return self->z;
} }
void GDAPI godot_quat_set_z(godot_quat *p_self, const godot_real val) { void GDAPI godot_quaternion_set_z(godot_quaternion *p_self, const godot_real val) {
Quat *self = (Quat *)p_self; Quaternion *self = (Quaternion *)p_self;
self->z = val; self->z = val;
} }
godot_real GDAPI godot_quat_get_w(const godot_quat *p_self) { godot_real GDAPI godot_quaternion_get_w(const godot_quaternion *p_self) {
const Quat *self = (const Quat *)p_self; const Quaternion *self = (const Quaternion *)p_self;
return self->w; return self->w;
} }
void GDAPI godot_quat_set_w(godot_quat *p_self, const godot_real val) { void GDAPI godot_quaternion_set_w(godot_quaternion *p_self, const godot_real val) {
Quat *self = (Quat *)p_self; Quaternion *self = (Quaternion *)p_self;
self->w = val; self->w = val;
} }
godot_string GDAPI godot_quat_as_string(const godot_quat *p_self) { godot_string GDAPI godot_quaternion_as_string(const godot_quaternion *p_self) {
godot_string ret; godot_string ret;
const Quat *self = (const Quat *)p_self; const Quaternion *self = (const Quaternion *)p_self;
memnew_placement(&ret, String(*self)); memnew_placement(&ret, String(*self));
return ret; return ret;
} }
godot_real GDAPI godot_quat_length(const godot_quat *p_self) { godot_real GDAPI godot_quaternion_length(const godot_quaternion *p_self) {
const Quat *self = (const Quat *)p_self; const Quaternion *self = (const Quaternion *)p_self;
return self->length(); return self->length();
} }
godot_real GDAPI godot_quat_length_squared(const godot_quat *p_self) { godot_real GDAPI godot_quaternion_length_squared(const godot_quaternion *p_self) {
const Quat *self = (const Quat *)p_self; const Quaternion *self = (const Quaternion *)p_self;
return self->length_squared(); return self->length_squared();
} }
godot_quat GDAPI godot_quat_normalized(const godot_quat *p_self) { godot_quaternion GDAPI godot_quaternion_normalized(const godot_quaternion *p_self) {
godot_quat dest; godot_quaternion dest;
const Quat *self = (const Quat *)p_self; const Quaternion *self = (const Quaternion *)p_self;
*((Quat *)&dest) = self->normalized(); *((Quaternion *)&dest) = self->normalized();
return dest; return dest;
} }
godot_bool GDAPI godot_quat_is_normalized(const godot_quat *p_self) { godot_bool GDAPI godot_quaternion_is_normalized(const godot_quaternion *p_self) {
const Quat *self = (const Quat *)p_self; const Quaternion *self = (const Quaternion *)p_self;
return self->is_normalized(); return self->is_normalized();
} }
godot_quat GDAPI godot_quat_inverse(const godot_quat *p_self) { godot_quaternion GDAPI godot_quaternion_inverse(const godot_quaternion *p_self) {
godot_quat dest; godot_quaternion dest;
const Quat *self = (const Quat *)p_self; const Quaternion *self = (const Quaternion *)p_self;
*((Quat *)&dest) = self->inverse(); *((Quaternion *)&dest) = self->inverse();
return dest; return dest;
} }
godot_real GDAPI godot_quat_dot(const godot_quat *p_self, const godot_quat *p_b) { godot_real GDAPI godot_quaternion_dot(const godot_quaternion *p_self, const godot_quaternion *p_b) {
const Quat *self = (const Quat *)p_self; const Quaternion *self = (const Quaternion *)p_self;
const Quat *b = (const Quat *)p_b; const Quaternion *b = (const Quaternion *)p_b;
return self->dot(*b); return self->dot(*b);
} }
godot_vector3 GDAPI godot_quat_xform(const godot_quat *p_self, const godot_vector3 *p_v) { godot_vector3 GDAPI godot_quaternion_xform(const godot_quaternion *p_self, const godot_vector3 *p_v) {
godot_vector3 dest; godot_vector3 dest;
const Quat *self = (const Quat *)p_self; const Quaternion *self = (const Quaternion *)p_self;
const Vector3 *v = (const Vector3 *)p_v; const Vector3 *v = (const Vector3 *)p_v;
*((Vector3 *)&dest) = self->xform(*v); *((Vector3 *)&dest) = self->xform(*v);
return dest; return dest;
} }
godot_quat GDAPI godot_quat_slerp(const godot_quat *p_self, const godot_quat *p_b, const godot_real p_t) { godot_quaternion GDAPI godot_quaternion_slerp(const godot_quaternion *p_self, const godot_quaternion *p_b, const godot_real p_t) {
godot_quat dest; godot_quaternion dest;
const Quat *self = (const Quat *)p_self; const Quaternion *self = (const Quaternion *)p_self;
const Quat *b = (const Quat *)p_b; const Quaternion *b = (const Quaternion *)p_b;
*((Quat *)&dest) = self->slerp(*b, p_t); *((Quaternion *)&dest) = self->slerp(*b, p_t);
return dest; return dest;
} }
godot_quat GDAPI godot_quat_slerpni(const godot_quat *p_self, const godot_quat *p_b, const godot_real p_t) { godot_quaternion GDAPI godot_quaternion_slerpni(const godot_quaternion *p_self, const godot_quaternion *p_b, const godot_real p_t) {
godot_quat dest; godot_quaternion dest;
const Quat *self = (const Quat *)p_self; const Quaternion *self = (const Quaternion *)p_self;
const Quat *b = (const Quat *)p_b; const Quaternion *b = (const Quaternion *)p_b;
*((Quat *)&dest) = self->slerpni(*b, p_t); *((Quaternion *)&dest) = self->slerpni(*b, p_t);
return dest; return dest;
} }
godot_quat GDAPI godot_quat_cubic_slerp(const godot_quat *p_self, const godot_quat *p_b, const godot_quat *p_pre_a, const godot_quat *p_post_b, const godot_real p_t) { godot_quaternion GDAPI godot_quaternion_cubic_slerp(const godot_quaternion *p_self, const godot_quaternion *p_b, const godot_quaternion *p_pre_a, const godot_quaternion *p_post_b, const godot_real p_t) {
godot_quat dest; godot_quaternion dest;
const Quat *self = (const Quat *)p_self; const Quaternion *self = (const Quaternion *)p_self;
const Quat *b = (const Quat *)p_b; const Quaternion *b = (const Quaternion *)p_b;
const Quat *pre_a = (const Quat *)p_pre_a; const Quaternion *pre_a = (const Quaternion *)p_pre_a;
const Quat *post_b = (const Quat *)p_post_b; const Quaternion *post_b = (const Quaternion *)p_post_b;
*((Quat *)&dest) = self->cubic_slerp(*b, *pre_a, *post_b, p_t); *((Quaternion *)&dest) = self->cubic_slerp(*b, *pre_a, *post_b, p_t);
return dest; return dest;
} }
godot_quat GDAPI godot_quat_operator_multiply(const godot_quat *p_self, const godot_real p_b) { godot_quaternion GDAPI godot_quaternion_operator_multiply(const godot_quaternion *p_self, const godot_real p_b) {
godot_quat raw_dest; godot_quaternion raw_dest;
Quat *dest = (Quat *)&raw_dest; Quaternion *dest = (Quaternion *)&raw_dest;
const Quat *self = (const Quat *)p_self; const Quaternion *self = (const Quaternion *)p_self;
*dest = *self * p_b; *dest = *self * p_b;
return raw_dest; return raw_dest;
} }
godot_quat GDAPI godot_quat_operator_add(const godot_quat *p_self, const godot_quat *p_b) { godot_quaternion GDAPI godot_quaternion_operator_add(const godot_quaternion *p_self, const godot_quaternion *p_b) {
godot_quat raw_dest; godot_quaternion raw_dest;
Quat *dest = (Quat *)&raw_dest; Quaternion *dest = (Quaternion *)&raw_dest;
const Quat *self = (const Quat *)p_self; const Quaternion *self = (const Quaternion *)p_self;
const Quat *b = (const Quat *)p_b; const Quaternion *b = (const Quaternion *)p_b;
*dest = *self + *b; *dest = *self + *b;
return raw_dest; return raw_dest;
} }
godot_quat GDAPI godot_quat_operator_subtract(const godot_quat *p_self, const godot_quat *p_b) { godot_quaternion GDAPI godot_quaternion_operator_subtract(const godot_quaternion *p_self, const godot_quaternion *p_b) {
godot_quat raw_dest; godot_quaternion raw_dest;
Quat *dest = (Quat *)&raw_dest; Quaternion *dest = (Quaternion *)&raw_dest;
const Quat *self = (const Quat *)p_self; const Quaternion *self = (const Quaternion *)p_self;
const Quat *b = (const Quat *)p_b; const Quaternion *b = (const Quaternion *)p_b;
*dest = *self - *b; *dest = *self - *b;
return raw_dest; return raw_dest;
} }
godot_quat GDAPI godot_quat_operator_divide(const godot_quat *p_self, const godot_real p_b) { godot_quaternion GDAPI godot_quaternion_operator_divide(const godot_quaternion *p_self, const godot_real p_b) {
godot_quat raw_dest; godot_quaternion raw_dest;
Quat *dest = (Quat *)&raw_dest; Quaternion *dest = (Quaternion *)&raw_dest;
const Quat *self = (const Quat *)p_self; const Quaternion *self = (const Quaternion *)p_self;
*dest = *self / p_b; *dest = *self / p_b;
return raw_dest; return raw_dest;
} }
godot_bool GDAPI godot_quat_operator_equal(const godot_quat *p_self, const godot_quat *p_b) { godot_bool GDAPI godot_quaternion_operator_equal(const godot_quaternion *p_self, const godot_quaternion *p_b) {
const Quat *self = (const Quat *)p_self; const Quaternion *self = (const Quaternion *)p_self;
const Quat *b = (const Quat *)p_b; const Quaternion *b = (const Quaternion *)p_b;
return *self == *b; return *self == *b;
} }
godot_quat GDAPI godot_quat_operator_neg(const godot_quat *p_self) { godot_quaternion GDAPI godot_quaternion_operator_neg(const godot_quaternion *p_self) {
godot_quat raw_dest; godot_quaternion raw_dest;
Quat *dest = (Quat *)&raw_dest; Quaternion *dest = (Quaternion *)&raw_dest;
const Quat *self = (const Quat *)p_self; const Quaternion *self = (const Quaternion *)p_self;
*dest = -(*self); *dest = -(*self);
return raw_dest; return raw_dest;
} }
void GDAPI godot_quat_set_axis_angle(godot_quat *p_self, const godot_vector3 *p_axis, const godot_real p_angle) { void GDAPI godot_quaternion_set_axis_angle(godot_quaternion *p_self, const godot_vector3 *p_axis, const godot_real p_angle) {
Quat *self = (Quat *)p_self; Quaternion *self = (Quaternion *)p_self;
const Vector3 *axis = (const Vector3 *)p_axis; const Vector3 *axis = (const Vector3 *)p_axis;
self->set_axis_angle(*axis, p_angle); self->set_axis_angle(*axis, p_angle);
} }

View File

@ -58,10 +58,10 @@ void GDAPI godot_transform_new(godot_transform *r_dest, const godot_basis *p_bas
*dest = Transform(*basis, *origin); *dest = Transform(*basis, *origin);
} }
void GDAPI godot_transform_new_with_quat(godot_transform *r_dest, const godot_quat *p_quat) { void GDAPI godot_transform_new_with_quaternion(godot_transform *r_dest, const godot_quaternion *p_quaternion) {
const Quat *quat = (const Quat *)p_quat; const Quaternion *quaternion = (const Quaternion *)p_quaternion;
Transform *dest = (Transform *)r_dest; Transform *dest = (Transform *)r_dest;
*dest = Transform(*quat); *dest = Transform(*quaternion);
} }
godot_basis GDAPI godot_transform_get_basis(const godot_transform *p_self) { godot_basis GDAPI godot_transform_get_basis(const godot_transform *p_self) {

View File

@ -129,10 +129,10 @@ void GDAPI godot_variant_new_plane(godot_variant *r_dest, const godot_plane *p_p
memnew_placement_custom(dest, Variant, Variant(*plane)); memnew_placement_custom(dest, Variant, Variant(*plane));
} }
void GDAPI godot_variant_new_quat(godot_variant *r_dest, const godot_quat *p_quat) { void GDAPI godot_variant_new_quaternion(godot_variant *r_dest, const godot_quaternion *p_quaternion) {
Variant *dest = (Variant *)r_dest; Variant *dest = (Variant *)r_dest;
Quat *quat = (Quat *)p_quat; Quaternion *quaternion = (Quaternion *)p_quaternion;
memnew_placement_custom(dest, Variant, Variant(*quat)); memnew_placement_custom(dest, Variant, Variant(*quaternion));
} }
void GDAPI godot_variant_new_aabb(godot_variant *r_dest, const godot_aabb *p_aabb) { void GDAPI godot_variant_new_aabb(godot_variant *r_dest, const godot_aabb *p_aabb) {
@ -313,10 +313,10 @@ godot_plane GDAPI godot_variant_as_plane(const godot_variant *p_self) {
return raw_dest; return raw_dest;
} }
godot_quat GDAPI godot_variant_as_quat(const godot_variant *p_self) { godot_quaternion GDAPI godot_variant_as_quaternion(const godot_variant *p_self) {
godot_quat raw_dest; godot_quaternion raw_dest;
const Variant *self = (const Variant *)p_self; const Variant *self = (const Variant *)p_self;
Quat *dest = (Quat *)&raw_dest; Quaternion *dest = (Quaternion *)&raw_dest;
*dest = *self; *dest = *self;
return raw_dest; return raw_dest;
} }

View File

@ -24,8 +24,7 @@
"minor": 3 "minor": 3
}, },
"next": null, "next": null,
"api": [ "api": [{
{
"name": "godot_dictionary_merge", "name": "godot_dictionary_merge",
"return_type": "void", "return_type": "void",
"arguments": [ "arguments": [
@ -174,8 +173,7 @@
} }
] ]
}, },
"api": [ "api": [{
{
"name": "godot_dictionary_duplicate", "name": "godot_dictionary_duplicate",
"return_type": "godot_dictionary", "return_type": "godot_dictionary",
"arguments": [ "arguments": [
@ -321,8 +319,7 @@
} }
] ]
}, },
"api": [ "api": [{
{
"name": "godot_color_to_abgr32", "name": "godot_color_to_abgr32",
"return_type": "godot_int", "return_type": "godot_int",
"arguments": [ "arguments": [
@ -440,10 +437,10 @@
] ]
}, },
{ {
"name": "godot_quat_set_axis_angle", "name": "godot_quaternion_set_axis_angle",
"return_type": "void", "return_type": "void",
"arguments": [ "arguments": [
["godot_quat *", "p_self"], ["godot_quaternion *", "p_self"],
["const godot_vector3 *", "p_axis"], ["const godot_vector3 *", "p_axis"],
["const godot_real", "p_angle"] ["const godot_real", "p_angle"]
] ]
@ -517,18 +514,18 @@
] ]
}, },
{ {
"name": "godot_basis_get_quat", "name": "godot_basis_get_quaternion",
"return_type": "godot_quat", "return_type": "godot_quaternion",
"arguments": [ "arguments": [
["const godot_basis *", "p_self"] ["const godot_basis *", "p_self"]
] ]
}, },
{ {
"name": "godot_basis_set_quat", "name": "godot_basis_set_quaternion",
"return_type": "void", "return_type": "void",
"arguments": [ "arguments": [
["godot_basis *", "p_self"], ["godot_basis *", "p_self"],
["const godot_quat *", "p_quat"] ["const godot_quaternion *", "p_quaternion"]
] ]
}, },
{ {
@ -551,11 +548,11 @@
] ]
}, },
{ {
"name": "godot_basis_set_quat_scale", "name": "godot_basis_set_quaternion_scale",
"return_type": "void", "return_type": "void",
"arguments": [ "arguments": [
["godot_basis *", "p_self"], ["godot_basis *", "p_self"],
["const godot_quat *", "p_quat"], ["const godot_quaternion *", "p_quaternion"],
["const godot_vector3 *", "p_scale"] ["const godot_vector3 *", "p_scale"]
] ]
}, },
@ -567,27 +564,27 @@
] ]
}, },
{ {
"name": "godot_quat_new_with_basis", "name": "godot_quaternion_new_with_basis",
"return_type": "void", "return_type": "void",
"arguments": [ "arguments": [
["godot_quat *", "r_dest"], ["godot_quaternion *", "r_dest"],
["const godot_basis *", "p_basis"] ["const godot_basis *", "p_basis"]
] ]
}, },
{ {
"name": "godot_quat_new_with_euler", "name": "godot_quaternion_new_with_euler",
"return_type": "void", "return_type": "void",
"arguments": [ "arguments": [
["godot_quat *", "r_dest"], ["godot_quaternion *", "r_dest"],
["const godot_vector3 *", "p_euler"] ["const godot_vector3 *", "p_euler"]
] ]
}, },
{ {
"name": "godot_transform_new_with_quat", "name": "godot_transform_new_with_quaternion",
"return_type": "void", "return_type": "void",
"arguments": [ "arguments": [
["godot_transform *", "r_dest"], ["godot_transform *", "r_dest"],
["const godot_quat *", "p_quat"] ["const godot_quaternion *", "p_quaternion"]
] ]
}, },
{ {
@ -610,8 +607,7 @@
} }
] ]
}, },
"api": [ "api": [{
{
"name": "godot_color_new_rgba", "name": "godot_color_new_rgba",
"return_type": "void", "return_type": "void",
"arguments": [ "arguments": [
@ -1085,10 +1081,10 @@
] ]
}, },
{ {
"name": "godot_quat_new", "name": "godot_quaternion_new",
"return_type": "void", "return_type": "void",
"arguments": [ "arguments": [
["godot_quat *", "r_dest"], ["godot_quaternion *", "r_dest"],
["const godot_real", "p_x"], ["const godot_real", "p_x"],
["const godot_real", "p_y"], ["const godot_real", "p_y"],
["const godot_real", "p_z"], ["const godot_real", "p_z"],
@ -1096,206 +1092,206 @@
] ]
}, },
{ {
"name": "godot_quat_new_with_axis_angle", "name": "godot_quaternion_new_with_axis_angle",
"return_type": "void", "return_type": "void",
"arguments": [ "arguments": [
["godot_quat *", "r_dest"], ["godot_quaternion *", "r_dest"],
["const godot_vector3 *", "p_axis"], ["const godot_vector3 *", "p_axis"],
["const godot_real", "p_angle"] ["const godot_real", "p_angle"]
] ]
}, },
{ {
"name": "godot_quat_get_x", "name": "godot_quaternion_get_x",
"return_type": "godot_real", "return_type": "godot_real",
"arguments": [ "arguments": [
["const godot_quat *", "p_self"] ["const godot_quaternion *", "p_self"]
] ]
}, },
{ {
"name": "godot_quat_set_x", "name": "godot_quaternion_set_x",
"return_type": "void", "return_type": "void",
"arguments": [ "arguments": [
["godot_quat *", "p_self"], ["godot_quaternion *", "p_self"],
["const godot_real", "val"] ["const godot_real", "val"]
] ]
}, },
{ {
"name": "godot_quat_get_y", "name": "godot_quaternion_get_y",
"return_type": "godot_real", "return_type": "godot_real",
"arguments": [ "arguments": [
["const godot_quat *", "p_self"] ["const godot_quaternion *", "p_self"]
] ]
}, },
{ {
"name": "godot_quat_set_y", "name": "godot_quaternion_set_y",
"return_type": "void", "return_type": "void",
"arguments": [ "arguments": [
["godot_quat *", "p_self"], ["godot_quaternion *", "p_self"],
["const godot_real", "val"] ["const godot_real", "val"]
] ]
}, },
{ {
"name": "godot_quat_get_z", "name": "godot_quaternion_get_z",
"return_type": "godot_real", "return_type": "godot_real",
"arguments": [ "arguments": [
["const godot_quat *", "p_self"] ["const godot_quaternion *", "p_self"]
] ]
}, },
{ {
"name": "godot_quat_set_z", "name": "godot_quaternion_set_z",
"return_type": "void", "return_type": "void",
"arguments": [ "arguments": [
["godot_quat *", "p_self"], ["godot_quaternion *", "p_self"],
["const godot_real", "val"] ["const godot_real", "val"]
] ]
}, },
{ {
"name": "godot_quat_get_w", "name": "godot_quaternion_get_w",
"return_type": "godot_real", "return_type": "godot_real",
"arguments": [ "arguments": [
["const godot_quat *", "p_self"] ["const godot_quaternion *", "p_self"]
] ]
}, },
{ {
"name": "godot_quat_set_w", "name": "godot_quaternion_set_w",
"return_type": "void", "return_type": "void",
"arguments": [ "arguments": [
["godot_quat *", "p_self"], ["godot_quaternion *", "p_self"],
["const godot_real", "val"] ["const godot_real", "val"]
] ]
}, },
{ {
"name": "godot_quat_as_string", "name": "godot_quaternion_as_string",
"return_type": "godot_string", "return_type": "godot_string",
"arguments": [ "arguments": [
["const godot_quat *", "p_self"] ["const godot_quaternion *", "p_self"]
] ]
}, },
{ {
"name": "godot_quat_length", "name": "godot_quaternion_length",
"return_type": "godot_real", "return_type": "godot_real",
"arguments": [ "arguments": [
["const godot_quat *", "p_self"] ["const godot_quaternion *", "p_self"]
] ]
}, },
{ {
"name": "godot_quat_length_squared", "name": "godot_quaternion_length_squared",
"return_type": "godot_real", "return_type": "godot_real",
"arguments": [ "arguments": [
["const godot_quat *", "p_self"] ["const godot_quaternion *", "p_self"]
] ]
}, },
{ {
"name": "godot_quat_normalized", "name": "godot_quaternion_normalized",
"return_type": "godot_quat", "return_type": "godot_quaternion",
"arguments": [ "arguments": [
["const godot_quat *", "p_self"] ["const godot_quaternion *", "p_self"]
] ]
}, },
{ {
"name": "godot_quat_is_normalized", "name": "godot_quaternion_is_normalized",
"return_type": "godot_bool", "return_type": "godot_bool",
"arguments": [ "arguments": [
["const godot_quat *", "p_self"] ["const godot_quaternion *", "p_self"]
] ]
}, },
{ {
"name": "godot_quat_inverse", "name": "godot_quaternion_inverse",
"return_type": "godot_quat", "return_type": "godot_quaternion",
"arguments": [ "arguments": [
["const godot_quat *", "p_self"] ["const godot_quaternion *", "p_self"]
] ]
}, },
{ {
"name": "godot_quat_dot", "name": "godot_quaternion_dot",
"return_type": "godot_real", "return_type": "godot_real",
"arguments": [ "arguments": [
["const godot_quat *", "p_self"], ["const godot_quaternion *", "p_self"],
["const godot_quat *", "p_b"] ["const godot_quaternion *", "p_b"]
] ]
}, },
{ {
"name": "godot_quat_xform", "name": "godot_quaternion_xform",
"return_type": "godot_vector3", "return_type": "godot_vector3",
"arguments": [ "arguments": [
["const godot_quat *", "p_self"], ["const godot_quaternion *", "p_self"],
["const godot_vector3 *", "p_v"] ["const godot_vector3 *", "p_v"]
] ]
}, },
{ {
"name": "godot_quat_slerp", "name": "godot_quaternion_slerp",
"return_type": "godot_quat", "return_type": "godot_quaternion",
"arguments": [ "arguments": [
["const godot_quat *", "p_self"], ["const godot_quaternion *", "p_self"],
["const godot_quat *", "p_b"], ["const godot_quaternion *", "p_b"],
["const godot_real", "p_t"] ["const godot_real", "p_t"]
] ]
}, },
{ {
"name": "godot_quat_slerpni", "name": "godot_quaternion_slerpni",
"return_type": "godot_quat", "return_type": "godot_quaternion",
"arguments": [ "arguments": [
["const godot_quat *", "p_self"], ["const godot_quaternion *", "p_self"],
["const godot_quat *", "p_b"], ["const godot_quaternion *", "p_b"],
["const godot_real", "p_t"] ["const godot_real", "p_t"]
] ]
}, },
{ {
"name": "godot_quat_cubic_slerp", "name": "godot_quaternion_cubic_slerp",
"return_type": "godot_quat", "return_type": "godot_quaternion",
"arguments": [ "arguments": [
["const godot_quat *", "p_self"], ["const godot_quaternion *", "p_self"],
["const godot_quat *", "p_b"], ["const godot_quaternion *", "p_b"],
["const godot_quat *", "p_pre_a"], ["const godot_quaternion *", "p_pre_a"],
["const godot_quat *", "p_post_b"], ["const godot_quaternion *", "p_post_b"],
["const godot_real", "p_t"] ["const godot_real", "p_t"]
] ]
}, },
{ {
"name": "godot_quat_operator_multiply", "name": "godot_quaternion_operator_multiply",
"return_type": "godot_quat", "return_type": "godot_quaternion",
"arguments": [ "arguments": [
["const godot_quat *", "p_self"], ["const godot_quaternion *", "p_self"],
["const godot_real", "p_b"] ["const godot_real", "p_b"]
] ]
}, },
{ {
"name": "godot_quat_operator_add", "name": "godot_quaternion_operator_add",
"return_type": "godot_quat", "return_type": "godot_quaternion",
"arguments": [ "arguments": [
["const godot_quat *", "p_self"], ["const godot_quaternion *", "p_self"],
["const godot_quat *", "p_b"] ["const godot_quaternion *", "p_b"]
] ]
}, },
{ {
"name": "godot_quat_operator_subtract", "name": "godot_quaternion_operator_subtract",
"return_type": "godot_quat", "return_type": "godot_quaternion",
"arguments": [ "arguments": [
["const godot_quat *", "p_self"], ["const godot_quaternion *", "p_self"],
["const godot_quat *", "p_b"] ["const godot_quaternion *", "p_b"]
] ]
}, },
{ {
"name": "godot_quat_operator_divide", "name": "godot_quaternion_operator_divide",
"return_type": "godot_quat", "return_type": "godot_quaternion",
"arguments": [ "arguments": [
["const godot_quat *", "p_self"], ["const godot_quaternion *", "p_self"],
["const godot_real", "p_b"] ["const godot_real", "p_b"]
] ]
}, },
{ {
"name": "godot_quat_operator_equal", "name": "godot_quaternion_operator_equal",
"return_type": "godot_bool", "return_type": "godot_bool",
"arguments": [ "arguments": [
["const godot_quat *", "p_self"], ["const godot_quaternion *", "p_self"],
["const godot_quat *", "p_b"] ["const godot_quaternion *", "p_b"]
] ]
}, },
{ {
"name": "godot_quat_operator_neg", "name": "godot_quaternion_operator_neg",
"return_type": "godot_quat", "return_type": "godot_quaternion",
"arguments": [ "arguments": [
["const godot_quat *", "p_self"] ["const godot_quaternion *", "p_self"]
] ]
}, },
{ {
@ -1446,11 +1442,11 @@
] ]
}, },
{ {
"name": "godot_basis_new_with_euler_quat", "name": "godot_basis_new_with_euler_quaternion",
"return_type": "void", "return_type": "void",
"arguments": [ "arguments": [
["godot_basis *", "r_dest"], ["godot_basis *", "r_dest"],
["const godot_quat *", "p_euler"] ["const godot_quaternion *", "p_euler"]
] ]
}, },
{ {
@ -4652,11 +4648,11 @@
] ]
}, },
{ {
"name": "godot_variant_new_quat", "name": "godot_variant_new_quaternion",
"return_type": "void", "return_type": "void",
"arguments": [ "arguments": [
["godot_variant *", "r_dest"], ["godot_variant *", "r_dest"],
["const godot_quat *", "p_quat"] ["const godot_quaternion *", "p_quaternion"]
] ]
}, },
{ {
@ -4858,8 +4854,8 @@
] ]
}, },
{ {
"name": "godot_variant_as_quat", "name": "godot_variant_as_quaternion",
"return_type": "godot_quat", "return_type": "godot_quaternion",
"arguments": [ "arguments": [
["const godot_variant *", "p_self"] ["const godot_variant *", "p_self"]
] ]
@ -6305,8 +6301,7 @@
{ {
"name": "godot_get_global_constants", "name": "godot_get_global_constants",
"return_type": "godot_dictionary", "return_type": "godot_dictionary",
"arguments": [ "arguments": []
]
}, },
{ {
"name": "godot_register_native_call_type", "name": "godot_register_native_call_type",
@ -6367,8 +6362,7 @@
} }
] ]
}, },
"extensions": [ "extensions": [{
{
"name": "nativescript", "name": "nativescript",
"type": "NATIVESCRIPT", "type": "NATIVESCRIPT",
"version": { "version": {
@ -6382,8 +6376,7 @@
"minor": 1 "minor": 1
}, },
"next": null, "next": null,
"api": [ "api": [{
{
"name": "godot_nativescript_set_method_argument_information", "name": "godot_nativescript_set_method_argument_information",
"return_type": "void", "return_type": "void",
"arguments": [ "arguments": [
@ -6498,8 +6491,7 @@
} }
] ]
}, },
"api": [ "api": [{
{
"name": "godot_nativescript_register_class", "name": "godot_nativescript_register_class",
"return_type": "void", "return_type": "void",
"arguments": [ "arguments": [
@ -6570,15 +6562,13 @@
"minor": 0 "minor": 0
}, },
"next": null, "next": null,
"api": [ "api": [{
{
"name": "godot_pluginscript_register_language", "name": "godot_pluginscript_register_language",
"return_type": "void", "return_type": "void",
"arguments": [ "arguments": [
["const godot_pluginscript_language_desc *", "language_desc"] ["const godot_pluginscript_language_desc *", "language_desc"]
] ]
} }]
]
}, },
{ {
"name": "android", "name": "android",
@ -6588,30 +6578,25 @@
"minor": 1 "minor": 1
}, },
"next": null, "next": null,
"api": [ "api": [{
{
"name": "godot_android_get_env", "name": "godot_android_get_env",
"return_type": "JNIEnv*", "return_type": "JNIEnv*",
"arguments": [ "arguments": []
]
}, },
{ {
"name": "godot_android_get_activity", "name": "godot_android_get_activity",
"return_type": "jobject", "return_type": "jobject",
"arguments": [ "arguments": []
]
}, },
{ {
"name": "godot_android_get_surface", "name": "godot_android_get_surface",
"return_type": "jobject", "return_type": "jobject",
"arguments": [ "arguments": []
]
}, },
{ {
"name": "godot_android_is_activity_resumed", "name": "godot_android_is_activity_resumed",
"return_type": "bool", "return_type": "bool",
"arguments": [ "arguments": []
]
} }
] ]
}, },
@ -6630,8 +6615,7 @@
"minor": 2 "minor": 2
}, },
"next": null, "next": null,
"api": [ "api": [{
{
"name": "godot_arvr_set_interface", "name": "godot_arvr_set_interface",
"return_type": "void", "return_type": "void",
"arguments": [ "arguments": [
@ -6648,8 +6632,7 @@
} }
] ]
}, },
"api": [ "api": [{
{
"name": "godot_arvr_register_interface", "name": "godot_arvr_register_interface",
"return_type": "void", "return_type": "void",
"arguments": [ "arguments": [
@ -6745,8 +6728,7 @@
"minor": 1 "minor": 1
}, },
"next": null, "next": null,
"api": [ "api": [{
{
"name": "godot_videodecoder_file_read", "name": "godot_videodecoder_file_read",
"return_type": "godot_int", "return_type": "godot_int",
"arguments": [ "arguments": [
@ -6787,8 +6769,7 @@
"minor": 2 "minor": 2
}, },
"next": null, "next": null,
"api": [ "api": [{
{
"name": "godot_net_set_webrtc_library", "name": "godot_net_set_webrtc_library",
"return_type": "godot_error", "return_type": "godot_error",
"arguments": [ "arguments": [
@ -6813,8 +6794,7 @@
} }
] ]
}, },
"api": [ "api": [{
{
"name": "godot_net_bind_stream_peer", "name": "godot_net_bind_stream_peer",
"return_type": "void", "return_type": "void",
"arguments": [ "arguments": [

View File

@ -52,7 +52,7 @@ typedef struct {
#endif #endif
#include <gdnative/gdnative.h> #include <gdnative/gdnative.h>
#include <gdnative/quat.h> #include <gdnative/quaternion.h>
#include <gdnative/vector3.h> #include <gdnative/vector3.h>
#ifdef __cplusplus #ifdef __cplusplus
@ -62,7 +62,7 @@ extern "C" {
void GDAPI godot_basis_new_with_rows(godot_basis *r_dest, const godot_vector3 *p_x_axis, const godot_vector3 *p_y_axis, const godot_vector3 *p_z_axis); void GDAPI godot_basis_new_with_rows(godot_basis *r_dest, const godot_vector3 *p_x_axis, const godot_vector3 *p_y_axis, const godot_vector3 *p_z_axis);
void GDAPI godot_basis_new_with_axis_and_angle(godot_basis *r_dest, const godot_vector3 *p_axis, const godot_real p_phi); void GDAPI godot_basis_new_with_axis_and_angle(godot_basis *r_dest, const godot_vector3 *p_axis, const godot_real p_phi);
void GDAPI godot_basis_new_with_euler(godot_basis *r_dest, const godot_vector3 *p_euler); void GDAPI godot_basis_new_with_euler(godot_basis *r_dest, const godot_vector3 *p_euler);
void GDAPI godot_basis_new_with_euler_quat(godot_basis *r_dest, const godot_quat *p_euler); void GDAPI godot_basis_new_with_euler_quaternion(godot_basis *r_dest, const godot_quaternion *p_euler);
godot_string GDAPI godot_basis_as_string(const godot_basis *p_self); godot_string GDAPI godot_basis_as_string(const godot_basis *p_self);
@ -82,15 +82,15 @@ godot_vector3 GDAPI godot_basis_get_scale(const godot_basis *p_self);
godot_vector3 GDAPI godot_basis_get_euler(const godot_basis *p_self); godot_vector3 GDAPI godot_basis_get_euler(const godot_basis *p_self);
godot_quat GDAPI godot_basis_get_quat(const godot_basis *p_self); godot_quaternion GDAPI godot_basis_get_quaternion(const godot_basis *p_self);
void GDAPI godot_basis_set_quat(godot_basis *p_self, const godot_quat *p_quat); void GDAPI godot_basis_set_quaternion(godot_basis *p_self, const godot_quaternion *p_quaternion);
void GDAPI godot_basis_set_axis_angle_scale(godot_basis *p_self, const godot_vector3 *p_axis, godot_real p_phi, const godot_vector3 *p_scale); void GDAPI godot_basis_set_axis_angle_scale(godot_basis *p_self, const godot_vector3 *p_axis, godot_real p_phi, const godot_vector3 *p_scale);
void GDAPI godot_basis_set_euler_scale(godot_basis *p_self, const godot_vector3 *p_euler, const godot_vector3 *p_scale); void GDAPI godot_basis_set_euler_scale(godot_basis *p_self, const godot_vector3 *p_euler, const godot_vector3 *p_scale);
void GDAPI godot_basis_set_quat_scale(godot_basis *p_self, const godot_quat *p_quat, const godot_vector3 *p_scale); void GDAPI godot_basis_set_quaternion_scale(godot_basis *p_self, const godot_quaternion *p_quaternion, const godot_vector3 *p_scale);
godot_real GDAPI godot_basis_tdotx(const godot_basis *p_self, const godot_vector3 *p_with); godot_real GDAPI godot_basis_tdotx(const godot_basis *p_self, const godot_vector3 *p_with);

View File

@ -168,9 +168,9 @@ typedef void godot_object;
#include <gdnative/plane.h> #include <gdnative/plane.h>
/////// Quat /////// Quaternion
#include <gdnative/quat.h> #include <gdnative/quaternion.h>
/////// AABB /////// AABB

View File

@ -1,118 +0,0 @@
/**************************************************************************/
/* quat.h */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* https://godotengine.org */
/**************************************************************************/
/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */
/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
/* "Software"), to deal in the Software without restriction, including */
/* without limitation the rights to use, copy, modify, merge, publish, */
/* distribute, sublicense, and/or sell copies of the Software, and to */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions: */
/* */
/* The above copyright notice and this permission notice shall be */
/* included in all copies or substantial portions of the Software. */
/* */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#ifndef GDNATIVE_QUAT_H
#define GDNATIVE_QUAT_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#define GODOT_QUAT_SIZE 16
#ifndef GODOT_CORE_API_GODOT_QUAT_TYPE_DEFINED
#define GODOT_CORE_API_GODOT_QUAT_TYPE_DEFINED
typedef struct {
uint8_t _dont_touch_that[GODOT_QUAT_SIZE];
} godot_quat;
#endif
// reduce extern "C" nesting for VS2013
#ifdef __cplusplus
}
#endif
#include <gdnative/gdnative.h>
#include <gdnative/vector3.h>
#ifdef __cplusplus
extern "C" {
#endif
void GDAPI godot_quat_new(godot_quat *r_dest, const godot_real p_x, const godot_real p_y, const godot_real p_z, const godot_real p_w);
void GDAPI godot_quat_new_with_axis_angle(godot_quat *r_dest, const godot_vector3 *p_axis, const godot_real p_angle);
void GDAPI godot_quat_new_with_basis(godot_quat *r_dest, const godot_basis *p_basis);
void GDAPI godot_quat_new_with_euler(godot_quat *r_dest, const godot_vector3 *p_euler);
godot_real GDAPI godot_quat_get_x(const godot_quat *p_self);
void GDAPI godot_quat_set_x(godot_quat *p_self, const godot_real val);
godot_real GDAPI godot_quat_get_y(const godot_quat *p_self);
void GDAPI godot_quat_set_y(godot_quat *p_self, const godot_real val);
godot_real GDAPI godot_quat_get_z(const godot_quat *p_self);
void GDAPI godot_quat_set_z(godot_quat *p_self, const godot_real val);
godot_real GDAPI godot_quat_get_w(const godot_quat *p_self);
void GDAPI godot_quat_set_w(godot_quat *p_self, const godot_real val);
godot_string GDAPI godot_quat_as_string(const godot_quat *p_self);
godot_real GDAPI godot_quat_length(const godot_quat *p_self);
godot_real GDAPI godot_quat_length_squared(const godot_quat *p_self);
godot_quat GDAPI godot_quat_normalized(const godot_quat *p_self);
godot_bool GDAPI godot_quat_is_normalized(const godot_quat *p_self);
godot_quat GDAPI godot_quat_inverse(const godot_quat *p_self);
godot_real GDAPI godot_quat_dot(const godot_quat *p_self, const godot_quat *p_b);
godot_vector3 GDAPI godot_quat_xform(const godot_quat *p_self, const godot_vector3 *p_v);
godot_quat GDAPI godot_quat_slerp(const godot_quat *p_self, const godot_quat *p_b, const godot_real p_t);
godot_quat GDAPI godot_quat_slerpni(const godot_quat *p_self, const godot_quat *p_b, const godot_real p_t);
godot_quat GDAPI godot_quat_cubic_slerp(const godot_quat *p_self, const godot_quat *p_b, const godot_quat *p_pre_a, const godot_quat *p_post_b, const godot_real p_t);
godot_quat GDAPI godot_quat_operator_multiply(const godot_quat *p_self, const godot_real p_b);
godot_quat GDAPI godot_quat_operator_add(const godot_quat *p_self, const godot_quat *p_b);
godot_quat GDAPI godot_quat_operator_subtract(const godot_quat *p_self, const godot_quat *p_b);
godot_quat GDAPI godot_quat_operator_divide(const godot_quat *p_self, const godot_real p_b);
godot_bool GDAPI godot_quat_operator_equal(const godot_quat *p_self, const godot_quat *p_b);
godot_quat GDAPI godot_quat_operator_neg(const godot_quat *p_self);
void GDAPI godot_quat_set_axis_angle(godot_quat *p_self, const godot_vector3 *p_axis, const godot_real p_angle);
#ifdef __cplusplus
}
#endif
#endif // GDNATIVE_QUAT_H

View File

@ -0,0 +1,118 @@
/**************************************************************************/
/* quaternion.h */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* https://godotengine.org */
/**************************************************************************/
/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */
/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
/* "Software"), to deal in the Software without restriction, including */
/* without limitation the rights to use, copy, modify, merge, publish, */
/* distribute, sublicense, and/or sell copies of the Software, and to */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions: */
/* */
/* The above copyright notice and this permission notice shall be */
/* included in all copies or substantial portions of the Software. */
/* */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#ifndef GDNATIVE_QUATERNION_H
#define GDNATIVE_QUATERNION_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#define GODOT_QUATERNION_SIZE 16
#ifndef GODOT_CORE_API_GODOT_QUATERNION_TYPE_DEFINED
#define GODOT_CORE_API_GODOT_QUATERNION_TYPE_DEFINED
typedef struct {
uint8_t _dont_touch_that[GODOT_QUATERNION_SIZE];
} godot_quaternion;
#endif
// reduce extern "C" nesting for VS2013
#ifdef __cplusplus
}
#endif
#include <gdnative/gdnative.h>
#include <gdnative/vector3.h>
#ifdef __cplusplus
extern "C" {
#endif
void GDAPI godot_quaternion_new(godot_quaternion *r_dest, const godot_real p_x, const godot_real p_y, const godot_real p_z, const godot_real p_w);
void GDAPI godot_quaternion_new_with_axis_angle(godot_quaternion *r_dest, const godot_vector3 *p_axis, const godot_real p_angle);
void GDAPI godot_quaternion_new_with_basis(godot_quaternion *r_dest, const godot_basis *p_basis);
void GDAPI godot_quaternion_new_with_euler(godot_quaternion *r_dest, const godot_vector3 *p_euler);
godot_real GDAPI godot_quaternion_get_x(const godot_quaternion *p_self);
void GDAPI godot_quaternion_set_x(godot_quaternion *p_self, const godot_real val);
godot_real GDAPI godot_quaternion_get_y(const godot_quaternion *p_self);
void GDAPI godot_quaternion_set_y(godot_quaternion *p_self, const godot_real val);
godot_real GDAPI godot_quaternion_get_z(const godot_quaternion *p_self);
void GDAPI godot_quaternion_set_z(godot_quaternion *p_self, const godot_real val);
godot_real GDAPI godot_quaternion_get_w(const godot_quaternion *p_self);
void GDAPI godot_quaternion_set_w(godot_quaternion *p_self, const godot_real val);
godot_string GDAPI godot_quaternion_as_string(const godot_quaternion *p_self);
godot_real GDAPI godot_quaternion_length(const godot_quaternion *p_self);
godot_real GDAPI godot_quaternion_length_squared(const godot_quaternion *p_self);
godot_quaternion GDAPI godot_quaternion_normalized(const godot_quaternion *p_self);
godot_bool GDAPI godot_quaternion_is_normalized(const godot_quaternion *p_self);
godot_quaternion GDAPI godot_quaternion_inverse(const godot_quaternion *p_self);
godot_real GDAPI godot_quaternion_dot(const godot_quaternion *p_self, const godot_quaternion *p_b);
godot_vector3 GDAPI godot_quaternion_xform(const godot_quaternion *p_self, const godot_vector3 *p_v);
godot_quaternion GDAPI godot_quaternion_slerp(const godot_quaternion *p_self, const godot_quaternion *p_b, const godot_real p_t);
godot_quaternion GDAPI godot_quaternion_slerpni(const godot_quaternion *p_self, const godot_quaternion *p_b, const godot_real p_t);
godot_quaternion GDAPI godot_quaternion_cubic_slerp(const godot_quaternion *p_self, const godot_quaternion *p_b, const godot_quaternion *p_pre_a, const godot_quaternion *p_post_b, const godot_real p_t);
godot_quaternion GDAPI godot_quaternion_operator_multiply(const godot_quaternion *p_self, const godot_real p_b);
godot_quaternion GDAPI godot_quaternion_operator_add(const godot_quaternion *p_self, const godot_quaternion *p_b);
godot_quaternion GDAPI godot_quaternion_operator_subtract(const godot_quaternion *p_self, const godot_quaternion *p_b);
godot_quaternion GDAPI godot_quaternion_operator_divide(const godot_quaternion *p_self, const godot_real p_b);
godot_bool GDAPI godot_quaternion_operator_equal(const godot_quaternion *p_self, const godot_quaternion *p_b);
godot_quaternion GDAPI godot_quaternion_operator_neg(const godot_quaternion *p_self);
void GDAPI godot_quaternion_set_axis_angle(godot_quaternion *p_self, const godot_vector3 *p_axis, const godot_real p_angle);
#ifdef __cplusplus
}
#endif
#endif // GDNATIVE_QUATERNION_H

View File

@ -62,7 +62,7 @@ extern "C" {
void GDAPI godot_transform_new_with_axis_origin(godot_transform *r_dest, const godot_vector3 *p_x_axis, const godot_vector3 *p_y_axis, const godot_vector3 *p_z_axis, const godot_vector3 *p_origin); void GDAPI godot_transform_new_with_axis_origin(godot_transform *r_dest, const godot_vector3 *p_x_axis, const godot_vector3 *p_y_axis, const godot_vector3 *p_z_axis, const godot_vector3 *p_origin);
void GDAPI godot_transform_new(godot_transform *r_dest, const godot_basis *p_basis, const godot_vector3 *p_origin); void GDAPI godot_transform_new(godot_transform *r_dest, const godot_basis *p_basis, const godot_vector3 *p_origin);
void GDAPI godot_transform_new_with_quat(godot_transform *r_dest, const godot_quat *p_quat); void GDAPI godot_transform_new_with_quaternion(godot_transform *r_dest, const godot_quaternion *p_quaternion);
godot_basis GDAPI godot_transform_get_basis(const godot_transform *p_self); godot_basis GDAPI godot_transform_get_basis(const godot_transform *p_self);
void GDAPI godot_transform_set_basis(godot_transform *p_self, const godot_basis *p_v); void GDAPI godot_transform_set_basis(godot_transform *p_self, const godot_basis *p_v);

View File

@ -62,7 +62,7 @@ typedef enum godot_variant_type {
GODOT_VARIANT_TYPE_VECTOR3, GODOT_VARIANT_TYPE_VECTOR3,
GODOT_VARIANT_TYPE_TRANSFORM2D, GODOT_VARIANT_TYPE_TRANSFORM2D,
GODOT_VARIANT_TYPE_PLANE, GODOT_VARIANT_TYPE_PLANE,
GODOT_VARIANT_TYPE_QUAT, // 10 GODOT_VARIANT_TYPE_QUATERNION, // 10
GODOT_VARIANT_TYPE_AABB, GODOT_VARIANT_TYPE_AABB,
GODOT_VARIANT_TYPE_BASIS, GODOT_VARIANT_TYPE_BASIS,
GODOT_VARIANT_TYPE_TRANSFORM, GODOT_VARIANT_TYPE_TRANSFORM,
@ -152,7 +152,7 @@ typedef enum godot_variant_operator {
#include <gdnative/node_path.h> #include <gdnative/node_path.h>
#include <gdnative/plane.h> #include <gdnative/plane.h>
#include <gdnative/pool_arrays.h> #include <gdnative/pool_arrays.h>
#include <gdnative/quat.h> #include <gdnative/quaternion.h>
#include <gdnative/rect2.h> #include <gdnative/rect2.h>
#include <gdnative/rid.h> #include <gdnative/rid.h>
#include <gdnative/string.h> #include <gdnative/string.h>
@ -184,7 +184,7 @@ void GDAPI godot_variant_new_rect2(godot_variant *r_dest, const godot_rect2 *p_r
void GDAPI godot_variant_new_vector3(godot_variant *r_dest, const godot_vector3 *p_v3); void GDAPI godot_variant_new_vector3(godot_variant *r_dest, const godot_vector3 *p_v3);
void GDAPI godot_variant_new_transform2d(godot_variant *r_dest, const godot_transform2d *p_t2d); void GDAPI godot_variant_new_transform2d(godot_variant *r_dest, const godot_transform2d *p_t2d);
void GDAPI godot_variant_new_plane(godot_variant *r_dest, const godot_plane *p_plane); void GDAPI godot_variant_new_plane(godot_variant *r_dest, const godot_plane *p_plane);
void GDAPI godot_variant_new_quat(godot_variant *r_dest, const godot_quat *p_quat); void GDAPI godot_variant_new_quaternion(godot_variant *r_dest, const godot_quaternion *p_quaternion);
void GDAPI godot_variant_new_aabb(godot_variant *r_dest, const godot_aabb *p_aabb); void GDAPI godot_variant_new_aabb(godot_variant *r_dest, const godot_aabb *p_aabb);
void GDAPI godot_variant_new_basis(godot_variant *r_dest, const godot_basis *p_basis); void GDAPI godot_variant_new_basis(godot_variant *r_dest, const godot_basis *p_basis);
void GDAPI godot_variant_new_transform(godot_variant *r_dest, const godot_transform *p_trans); void GDAPI godot_variant_new_transform(godot_variant *r_dest, const godot_transform *p_trans);
@ -212,7 +212,7 @@ godot_rect2 GDAPI godot_variant_as_rect2(const godot_variant *p_self);
godot_vector3 GDAPI godot_variant_as_vector3(const godot_variant *p_self); godot_vector3 GDAPI godot_variant_as_vector3(const godot_variant *p_self);
godot_transform2d GDAPI godot_variant_as_transform2d(const godot_variant *p_self); godot_transform2d GDAPI godot_variant_as_transform2d(const godot_variant *p_self);
godot_plane GDAPI godot_variant_as_plane(const godot_variant *p_self); godot_plane GDAPI godot_variant_as_plane(const godot_variant *p_self);
godot_quat GDAPI godot_variant_as_quat(const godot_variant *p_self); godot_quaternion GDAPI godot_variant_as_quaternion(const godot_variant *p_self);
godot_aabb GDAPI godot_variant_as_aabb(const godot_variant *p_self); godot_aabb GDAPI godot_variant_as_aabb(const godot_variant *p_self);
godot_basis GDAPI godot_variant_as_basis(const godot_variant *p_self); godot_basis GDAPI godot_variant_as_basis(const godot_variant *p_self);
godot_transform GDAPI godot_variant_as_transform(const godot_variant *p_self); godot_transform GDAPI godot_variant_as_transform(const godot_variant *p_self);

View File

@ -357,7 +357,7 @@ void unregister_gdnative_types(ModuleRegistrationLevel p_level) {
print_line(String("node_path:\t") + itos(sizeof(NodePath))); print_line(String("node_path:\t") + itos(sizeof(NodePath)));
print_line(String("plane:\t") + itos(sizeof(Plane))); print_line(String("plane:\t") + itos(sizeof(Plane)));
print_line(String("poolarray:\t") + itos(sizeof(PoolByteArray))); print_line(String("poolarray:\t") + itos(sizeof(PoolByteArray)));
print_line(String("quat:\t") + itos(sizeof(Quat))); print_line(String("quaternion:\t") + itos(sizeof(Quaternion)));
print_line(String("rect2:\t") + itos(sizeof(Rect2))); print_line(String("rect2:\t") + itos(sizeof(Rect2)));
print_line(String("aabb:\t") + itos(sizeof(AABB))); print_line(String("aabb:\t") + itos(sizeof(AABB)));
print_line(String("rid:\t") + itos(sizeof(RID))); print_line(String("rid:\t") + itos(sizeof(RID)));