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;
}
godot_quat GDAPI godot_basis_get_quat(const godot_basis *p_self) {
godot_quat dest;
godot_quaternion GDAPI godot_basis_get_quaternion(const godot_basis *p_self) {
godot_quaternion dest;
const Basis *self = (const Basis *)p_self;
*((Quat *)&dest) = self->get_quat();
*((Quaternion *)&dest) = self->get_quaternion();
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;
const Quat *quat = (const Quat *)p_quat;
self->set_quat(*quat);
const Quaternion *quaternion = (const Quaternion *)p_quaternion;
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) {
@ -142,11 +142,11 @@ void GDAPI godot_basis_set_euler_scale(godot_basis *p_self, const godot_vector3
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;
const Quat *quat = (const Quat *)p_quat;
const Quaternion *quaternion = (const Quaternion *)p_quaternion;
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) {
@ -200,9 +200,9 @@ void GDAPI godot_basis_new(godot_basis *r_dest) {
*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;
const Quat *euler = (const Quat *)p_euler;
const Quaternion *euler = (const Quaternion *)p_euler;
*dest = Basis(*euler);
}

View File

@ -1,5 +1,5 @@
/**************************************************************************/
/* quat.cpp */
/* quaternion.cpp */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,206 +28,206 @@
/* 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"
#ifdef __cplusplus
extern "C" {
#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) {
Quat *dest = (Quat *)r_dest;
*dest = Quat(p_x, p_y, p_z, 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) {
Quaternion *dest = (Quaternion *)r_dest;
*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;
Quat *dest = (Quat *)r_dest;
*dest = Quat(*axis, p_angle);
Quaternion *dest = (Quaternion *)r_dest;
*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;
Quat *dest = (Quat *)r_dest;
*dest = Quat(*basis);
Quaternion *dest = (Quaternion *)r_dest;
*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;
Quat *dest = (Quat *)r_dest;
*dest = Quat(*euler);
Quaternion *dest = (Quaternion *)r_dest;
*dest = Quaternion(*euler);
}
godot_real GDAPI godot_quat_get_x(const godot_quat *p_self) {
const Quat *self = (const Quat *)p_self;
godot_real GDAPI godot_quaternion_get_x(const godot_quaternion *p_self) {
const Quaternion *self = (const Quaternion *)p_self;
return self->x;
}
void GDAPI godot_quat_set_x(godot_quat *p_self, const godot_real val) {
Quat *self = (Quat *)p_self;
void GDAPI godot_quaternion_set_x(godot_quaternion *p_self, const godot_real val) {
Quaternion *self = (Quaternion *)p_self;
self->x = val;
}
godot_real GDAPI godot_quat_get_y(const godot_quat *p_self) {
const Quat *self = (const Quat *)p_self;
godot_real GDAPI godot_quaternion_get_y(const godot_quaternion *p_self) {
const Quaternion *self = (const Quaternion *)p_self;
return self->y;
}
void GDAPI godot_quat_set_y(godot_quat *p_self, const godot_real val) {
Quat *self = (Quat *)p_self;
void GDAPI godot_quaternion_set_y(godot_quaternion *p_self, const godot_real val) {
Quaternion *self = (Quaternion *)p_self;
self->y = val;
}
godot_real GDAPI godot_quat_get_z(const godot_quat *p_self) {
const Quat *self = (const Quat *)p_self;
godot_real GDAPI godot_quaternion_get_z(const godot_quaternion *p_self) {
const Quaternion *self = (const Quaternion *)p_self;
return self->z;
}
void GDAPI godot_quat_set_z(godot_quat *p_self, const godot_real val) {
Quat *self = (Quat *)p_self;
void GDAPI godot_quaternion_set_z(godot_quaternion *p_self, const godot_real val) {
Quaternion *self = (Quaternion *)p_self;
self->z = val;
}
godot_real GDAPI godot_quat_get_w(const godot_quat *p_self) {
const Quat *self = (const Quat *)p_self;
godot_real GDAPI godot_quaternion_get_w(const godot_quaternion *p_self) {
const Quaternion *self = (const Quaternion *)p_self;
return self->w;
}
void GDAPI godot_quat_set_w(godot_quat *p_self, const godot_real val) {
Quat *self = (Quat *)p_self;
void GDAPI godot_quaternion_set_w(godot_quaternion *p_self, const godot_real val) {
Quaternion *self = (Quaternion *)p_self;
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;
const Quat *self = (const Quat *)p_self;
const Quaternion *self = (const Quaternion *)p_self;
memnew_placement(&ret, String(*self));
return ret;
}
godot_real GDAPI godot_quat_length(const godot_quat *p_self) {
const Quat *self = (const Quat *)p_self;
godot_real GDAPI godot_quaternion_length(const godot_quaternion *p_self) {
const Quaternion *self = (const Quaternion *)p_self;
return self->length();
}
godot_real GDAPI godot_quat_length_squared(const godot_quat *p_self) {
const Quat *self = (const Quat *)p_self;
godot_real GDAPI godot_quaternion_length_squared(const godot_quaternion *p_self) {
const Quaternion *self = (const Quaternion *)p_self;
return self->length_squared();
}
godot_quat GDAPI godot_quat_normalized(const godot_quat *p_self) {
godot_quat dest;
const Quat *self = (const Quat *)p_self;
*((Quat *)&dest) = self->normalized();
godot_quaternion GDAPI godot_quaternion_normalized(const godot_quaternion *p_self) {
godot_quaternion dest;
const Quaternion *self = (const Quaternion *)p_self;
*((Quaternion *)&dest) = self->normalized();
return dest;
}
godot_bool GDAPI godot_quat_is_normalized(const godot_quat *p_self) {
const Quat *self = (const Quat *)p_self;
godot_bool GDAPI godot_quaternion_is_normalized(const godot_quaternion *p_self) {
const Quaternion *self = (const Quaternion *)p_self;
return self->is_normalized();
}
godot_quat GDAPI godot_quat_inverse(const godot_quat *p_self) {
godot_quat dest;
const Quat *self = (const Quat *)p_self;
*((Quat *)&dest) = self->inverse();
godot_quaternion GDAPI godot_quaternion_inverse(const godot_quaternion *p_self) {
godot_quaternion dest;
const Quaternion *self = (const Quaternion *)p_self;
*((Quaternion *)&dest) = self->inverse();
return dest;
}
godot_real GDAPI godot_quat_dot(const godot_quat *p_self, const godot_quat *p_b) {
const Quat *self = (const Quat *)p_self;
const Quat *b = (const Quat *)p_b;
godot_real GDAPI godot_quaternion_dot(const godot_quaternion *p_self, const godot_quaternion *p_b) {
const Quaternion *self = (const Quaternion *)p_self;
const Quaternion *b = (const Quaternion *)p_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;
const Quat *self = (const Quat *)p_self;
const Quaternion *self = (const Quaternion *)p_self;
const Vector3 *v = (const Vector3 *)p_v;
*((Vector3 *)&dest) = self->xform(*v);
return dest;
}
godot_quat GDAPI godot_quat_slerp(const godot_quat *p_self, const godot_quat *p_b, const godot_real p_t) {
godot_quat dest;
const Quat *self = (const Quat *)p_self;
const Quat *b = (const Quat *)p_b;
*((Quat *)&dest) = self->slerp(*b, p_t);
godot_quaternion GDAPI godot_quaternion_slerp(const godot_quaternion *p_self, const godot_quaternion *p_b, const godot_real p_t) {
godot_quaternion dest;
const Quaternion *self = (const Quaternion *)p_self;
const Quaternion *b = (const Quaternion *)p_b;
*((Quaternion *)&dest) = self->slerp(*b, p_t);
return dest;
}
godot_quat GDAPI godot_quat_slerpni(const godot_quat *p_self, const godot_quat *p_b, const godot_real p_t) {
godot_quat dest;
const Quat *self = (const Quat *)p_self;
const Quat *b = (const Quat *)p_b;
*((Quat *)&dest) = self->slerpni(*b, 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 dest;
const Quaternion *self = (const Quaternion *)p_self;
const Quaternion *b = (const Quaternion *)p_b;
*((Quaternion *)&dest) = self->slerpni(*b, p_t);
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_quat dest;
const Quat *self = (const Quat *)p_self;
const Quat *b = (const Quat *)p_b;
const Quat *pre_a = (const Quat *)p_pre_a;
const Quat *post_b = (const Quat *)p_post_b;
*((Quat *)&dest) = self->cubic_slerp(*b, *pre_a, *post_b, 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 dest;
const Quaternion *self = (const Quaternion *)p_self;
const Quaternion *b = (const Quaternion *)p_b;
const Quaternion *pre_a = (const Quaternion *)p_pre_a;
const Quaternion *post_b = (const Quaternion *)p_post_b;
*((Quaternion *)&dest) = self->cubic_slerp(*b, *pre_a, *post_b, p_t);
return dest;
}
godot_quat GDAPI godot_quat_operator_multiply(const godot_quat *p_self, const godot_real p_b) {
godot_quat raw_dest;
Quat *dest = (Quat *)&raw_dest;
const Quat *self = (const Quat *)p_self;
godot_quaternion GDAPI godot_quaternion_operator_multiply(const godot_quaternion *p_self, const godot_real p_b) {
godot_quaternion raw_dest;
Quaternion *dest = (Quaternion *)&raw_dest;
const Quaternion *self = (const Quaternion *)p_self;
*dest = *self * p_b;
return raw_dest;
}
godot_quat GDAPI godot_quat_operator_add(const godot_quat *p_self, const godot_quat *p_b) {
godot_quat raw_dest;
Quat *dest = (Quat *)&raw_dest;
const Quat *self = (const Quat *)p_self;
const Quat *b = (const Quat *)p_b;
godot_quaternion GDAPI godot_quaternion_operator_add(const godot_quaternion *p_self, const godot_quaternion *p_b) {
godot_quaternion raw_dest;
Quaternion *dest = (Quaternion *)&raw_dest;
const Quaternion *self = (const Quaternion *)p_self;
const Quaternion *b = (const Quaternion *)p_b;
*dest = *self + *b;
return raw_dest;
}
godot_quat GDAPI godot_quat_operator_subtract(const godot_quat *p_self, const godot_quat *p_b) {
godot_quat raw_dest;
Quat *dest = (Quat *)&raw_dest;
const Quat *self = (const Quat *)p_self;
const Quat *b = (const Quat *)p_b;
godot_quaternion GDAPI godot_quaternion_operator_subtract(const godot_quaternion *p_self, const godot_quaternion *p_b) {
godot_quaternion raw_dest;
Quaternion *dest = (Quaternion *)&raw_dest;
const Quaternion *self = (const Quaternion *)p_self;
const Quaternion *b = (const Quaternion *)p_b;
*dest = *self - *b;
return raw_dest;
}
godot_quat GDAPI godot_quat_operator_divide(const godot_quat *p_self, const godot_real p_b) {
godot_quat raw_dest;
Quat *dest = (Quat *)&raw_dest;
const Quat *self = (const Quat *)p_self;
godot_quaternion GDAPI godot_quaternion_operator_divide(const godot_quaternion *p_self, const godot_real p_b) {
godot_quaternion raw_dest;
Quaternion *dest = (Quaternion *)&raw_dest;
const Quaternion *self = (const Quaternion *)p_self;
*dest = *self / p_b;
return raw_dest;
}
godot_bool GDAPI godot_quat_operator_equal(const godot_quat *p_self, const godot_quat *p_b) {
const Quat *self = (const Quat *)p_self;
const Quat *b = (const Quat *)p_b;
godot_bool GDAPI godot_quaternion_operator_equal(const godot_quaternion *p_self, const godot_quaternion *p_b) {
const Quaternion *self = (const Quaternion *)p_self;
const Quaternion *b = (const Quaternion *)p_b;
return *self == *b;
}
godot_quat GDAPI godot_quat_operator_neg(const godot_quat *p_self) {
godot_quat raw_dest;
Quat *dest = (Quat *)&raw_dest;
const Quat *self = (const Quat *)p_self;
godot_quaternion GDAPI godot_quaternion_operator_neg(const godot_quaternion *p_self) {
godot_quaternion raw_dest;
Quaternion *dest = (Quaternion *)&raw_dest;
const Quaternion *self = (const Quaternion *)p_self;
*dest = -(*self);
return raw_dest;
}
void GDAPI godot_quat_set_axis_angle(godot_quat *p_self, const godot_vector3 *p_axis, const godot_real p_angle) {
Quat *self = (Quat *)p_self;
void GDAPI godot_quaternion_set_axis_angle(godot_quaternion *p_self, const godot_vector3 *p_axis, const godot_real p_angle) {
Quaternion *self = (Quaternion *)p_self;
const Vector3 *axis = (const Vector3 *)p_axis;
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);
}
void GDAPI godot_transform_new_with_quat(godot_transform *r_dest, const godot_quat *p_quat) {
const Quat *quat = (const Quat *)p_quat;
void GDAPI godot_transform_new_with_quaternion(godot_transform *r_dest, const godot_quaternion *p_quaternion) {
const Quaternion *quaternion = (const Quaternion *)p_quaternion;
Transform *dest = (Transform *)r_dest;
*dest = Transform(*quat);
*dest = Transform(*quaternion);
}
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));
}
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;
Quat *quat = (Quat *)p_quat;
memnew_placement_custom(dest, Variant, Variant(*quat));
Quaternion *quaternion = (Quaternion *)p_quaternion;
memnew_placement_custom(dest, Variant, Variant(*quaternion));
}
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;
}
godot_quat GDAPI godot_variant_as_quat(const godot_variant *p_self) {
godot_quat raw_dest;
godot_quaternion GDAPI godot_variant_as_quaternion(const godot_variant *p_self) {
godot_quaternion raw_dest;
const Variant *self = (const Variant *)p_self;
Quat *dest = (Quat *)&raw_dest;
Quaternion *dest = (Quaternion *)&raw_dest;
*dest = *self;
return raw_dest;
}

File diff suppressed because it is too large Load Diff

View File

@ -52,7 +52,7 @@ typedef struct {
#endif
#include <gdnative/gdnative.h>
#include <gdnative/quat.h>
#include <gdnative/quaternion.h>
#include <gdnative/vector3.h>
#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_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_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);
@ -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_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_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);

View File

@ -168,9 +168,9 @@ typedef void godot_object;
#include <gdnative/plane.h>
/////// Quat
/////// Quaternion
#include <gdnative/quat.h>
#include <gdnative/quaternion.h>
/////// 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(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);
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_TRANSFORM2D,
GODOT_VARIANT_TYPE_PLANE,
GODOT_VARIANT_TYPE_QUAT, // 10
GODOT_VARIANT_TYPE_QUATERNION, // 10
GODOT_VARIANT_TYPE_AABB,
GODOT_VARIANT_TYPE_BASIS,
GODOT_VARIANT_TYPE_TRANSFORM,
@ -152,7 +152,7 @@ typedef enum godot_variant_operator {
#include <gdnative/node_path.h>
#include <gdnative/plane.h>
#include <gdnative/pool_arrays.h>
#include <gdnative/quat.h>
#include <gdnative/quaternion.h>
#include <gdnative/rect2.h>
#include <gdnative/rid.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_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_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_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);
@ -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_transform2d GDAPI godot_variant_as_transform2d(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_basis GDAPI godot_variant_as_basis(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("plane:\t") + itos(sizeof(Plane)));
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("aabb:\t") + itos(sizeof(AABB)));
print_line(String("rid:\t") + itos(sizeof(RID)));