#include <whiteout/vector_types.h>
#include <whiteout/textures/texture.h>
#include <cstring>
#include <type_traits>
#include "whiteout_v.h"
namespace {
template <typename Cpp, typename C>
inline Cpp fromC_impl(const C& v) {
static_assert(sizeof(Cpp) == sizeof(C), "value ABI layout mismatch");
static_assert(std::is_trivially_copyable<Cpp>::value, "not trivially copyable");
Cpp out;
std::memcpy(&out, &v, sizeof(out));
return out;
}
template <typename C, typename Cpp>
inline C toC_impl(const Cpp& v) {
static_assert(sizeof(Cpp) == sizeof(C), "value ABI layout mismatch");
C out;
std::memcpy(&out, &v, sizeof(out));
return out;
}
inline whiteout::Vector2f fromC(const whiteout_v_Vector2f& v) { return fromC_impl<whiteout::Vector2f>(v); }
inline whiteout_v_Vector2f toC(const whiteout::Vector2f& v) { return toC_impl<whiteout_v_Vector2f>(v); }
inline whiteout::Vector3f fromC(const whiteout_v_Vector3f& v) { return fromC_impl<whiteout::Vector3f>(v); }
inline whiteout_v_Vector3f toC(const whiteout::Vector3f& v) { return toC_impl<whiteout_v_Vector3f>(v); }
inline whiteout::Vector4f fromC(const whiteout_v_Vector4f& v) { return fromC_impl<whiteout::Vector4f>(v); }
inline whiteout_v_Vector4f toC(const whiteout::Vector4f& v) { return toC_impl<whiteout_v_Vector4f>(v); }
inline whiteout::Quaternion fromC(const whiteout_v_Quaternion& v) { return fromC_impl<whiteout::Quaternion>(v); }
inline whiteout_v_Quaternion toC(const whiteout::Quaternion& v) { return toC_impl<whiteout_v_Quaternion>(v); }
inline whiteout::Matrix33f fromC(const whiteout_v_Matrix33f& v) { return fromC_impl<whiteout::Matrix33f>(v); }
inline whiteout_v_Matrix33f toC(const whiteout::Matrix33f& v) { return toC_impl<whiteout_v_Matrix33f>(v); }
inline whiteout::Matrix44f fromC(const whiteout_v_Matrix44f& v) { return fromC_impl<whiteout::Matrix44f>(v); }
inline whiteout_v_Matrix44f toC(const whiteout::Matrix44f& v) { return toC_impl<whiteout_v_Matrix44f>(v); }
static_assert(sizeof(whiteout::Vector2f) == 8, "whiteout::Vector2f changed size");
static_assert(sizeof(whiteout_v_Vector2f) == 8, "whiteout_v_Vector2f changed size");
static_assert(sizeof(whiteout::Vector3f) == 12, "whiteout::Vector3f changed size");
static_assert(sizeof(whiteout_v_Vector3f) == 12, "whiteout_v_Vector3f changed size");
static_assert(sizeof(whiteout::Vector4f) == 16, "whiteout::Vector4f changed size");
static_assert(sizeof(whiteout_v_Vector4f) == 16, "whiteout_v_Vector4f changed size");
static_assert(sizeof(whiteout::Quaternion) == 16, "whiteout::Quaternion changed size");
static_assert(sizeof(whiteout_v_Quaternion) == 16, "whiteout_v_Quaternion changed size");
static_assert(sizeof(whiteout::Matrix33f) == 36, "whiteout::Matrix33f changed size");
static_assert(sizeof(whiteout_v_Matrix33f) == 36, "whiteout_v_Matrix33f changed size");
static_assert(sizeof(whiteout::Matrix44f) == 64, "whiteout::Matrix44f changed size");
static_assert(sizeof(whiteout_v_Matrix44f) == 64, "whiteout_v_Matrix44f changed size");
}
extern "C" {
whiteout_v_Layout whiteout_v_layout(void) {
whiteout_v_Layout l;
l.abi_version = WHITEOUT_V_ABI_VERSION;
l.vector2f = (uint32_t)sizeof(whiteout_v_Vector2f);
l.vector3f = (uint32_t)sizeof(whiteout_v_Vector3f);
l.vector4f = (uint32_t)sizeof(whiteout_v_Vector4f);
l.quaternion = (uint32_t)sizeof(whiteout_v_Quaternion);
l.matrix33f = (uint32_t)sizeof(whiteout_v_Matrix33f);
l.matrix44f = (uint32_t)sizeof(whiteout_v_Matrix44f);
return l;
}
float whiteout_v_Vector2f_dot(whiteout_v_Vector2f self, whiteout_v_Vector2f other) {
const whiteout::Vector2f __self = fromC(self);
const whiteout::Vector2f __other = fromC(other);
return __self.dot(__other);
}
float whiteout_v_Vector2f_length(whiteout_v_Vector2f self) {
const whiteout::Vector2f __self = fromC(self);
return __self.length();
}
float whiteout_v_Vector2f_length_squared(whiteout_v_Vector2f self) {
const whiteout::Vector2f __self = fromC(self);
return __self.length_squared();
}
void whiteout_v_Vector2f_normalize(whiteout_v_Vector2f* self) {
whiteout::Vector2f __self = fromC(*self);
__self.normalize();
*self = toC(__self);
}
whiteout_v_Vector2f whiteout_v_Vector2f_normalized(whiteout_v_Vector2f self) {
const whiteout::Vector2f __self = fromC(self);
return toC(__self.normalized());
}
whiteout_v_Vector2f whiteout_v_Vector2f_add(whiteout_v_Vector2f self, whiteout_v_Vector2f other) {
const whiteout::Vector2f __self = fromC(self);
const whiteout::Vector2f __other = fromC(other);
return toC(__self + __other);
}
whiteout_v_Vector2f whiteout_v_Vector2f_sub(whiteout_v_Vector2f self, whiteout_v_Vector2f other) {
const whiteout::Vector2f __self = fromC(self);
const whiteout::Vector2f __other = fromC(other);
return toC(__self - __other);
}
whiteout_v_Vector2f whiteout_v_Vector2f_mul(whiteout_v_Vector2f self, whiteout_v_Vector2f other) {
const whiteout::Vector2f __self = fromC(self);
const whiteout::Vector2f __other = fromC(other);
return toC(__self * __other);
}
whiteout_v_Vector2f whiteout_v_Vector2f_div(whiteout_v_Vector2f self, whiteout_v_Vector2f other) {
const whiteout::Vector2f __self = fromC(self);
const whiteout::Vector2f __other = fromC(other);
return toC(__self / __other);
}
whiteout_v_Vector2f whiteout_v_Vector2f_mul_scalar(whiteout_v_Vector2f self, float scalar) {
const whiteout::Vector2f __self = fromC(self);
return toC(__self * scalar);
}
whiteout_v_Vector2f whiteout_v_Vector2f_div_scalar(whiteout_v_Vector2f self, float scalar) {
const whiteout::Vector2f __self = fromC(self);
return toC(__self / scalar);
}
whiteout_v_Vector2f whiteout_v_Vector2f_negate(whiteout_v_Vector2f self) {
const whiteout::Vector2f __self = fromC(self);
return toC(-__self);
}
int32_t whiteout_v_Vector2f_equals(whiteout_v_Vector2f self, whiteout_v_Vector2f other) {
const whiteout::Vector2f __self = fromC(self);
const whiteout::Vector2f __other = fromC(other);
return (__self == __other) ? 1 : 0;
}
whiteout_v_Vector2f whiteout_v_Vector2f_lerp(whiteout_v_Vector2f start, whiteout_v_Vector2f end, float t) {
const whiteout::Vector2f __start = fromC(start);
const whiteout::Vector2f __end = fromC(end);
return toC(whiteout::Vector2f::lerp(__start, __end, t));
}
whiteout_v_Vector2f whiteout_v_Vector2f_tcb_in_tangent(whiteout_v_Vector2f prev, whiteout_v_Vector2f current, whiteout_v_Vector2f next, float tension, float continuity, float bias) {
const whiteout::Vector2f __prev = fromC(prev);
const whiteout::Vector2f __current = fromC(current);
const whiteout::Vector2f __next = fromC(next);
return toC(whiteout::Vector2f::tcb_in_tangent(__prev, __current, __next, tension, continuity, bias));
}
whiteout_v_Vector2f whiteout_v_Vector2f_tcb_out_tangent(whiteout_v_Vector2f prev, whiteout_v_Vector2f current, whiteout_v_Vector2f next, float tension, float continuity, float bias) {
const whiteout::Vector2f __prev = fromC(prev);
const whiteout::Vector2f __current = fromC(current);
const whiteout::Vector2f __next = fromC(next);
return toC(whiteout::Vector2f::tcb_out_tangent(__prev, __current, __next, tension, continuity, bias));
}
whiteout_v_Vector2f whiteout_v_Vector2f_bezier_lerp(whiteout_v_Vector2f start, whiteout_v_Vector2f outtan, whiteout_v_Vector2f intan, whiteout_v_Vector2f end, float t) {
const whiteout::Vector2f __start = fromC(start);
const whiteout::Vector2f __outtan = fromC(outtan);
const whiteout::Vector2f __intan = fromC(intan);
const whiteout::Vector2f __end = fromC(end);
return toC(whiteout::Vector2f::bezier_lerp(__start, __outtan, __intan, __end, t));
}
whiteout_v_Vector2f whiteout_v_Vector2f_hermite_lerp(whiteout_v_Vector2f prev, whiteout_v_Vector2f start, whiteout_v_Vector2f end, whiteout_v_Vector2f next, float t) {
const whiteout::Vector2f __prev = fromC(prev);
const whiteout::Vector2f __start = fromC(start);
const whiteout::Vector2f __end = fromC(end);
const whiteout::Vector2f __next = fromC(next);
return toC(whiteout::Vector2f::hermite_lerp(__prev, __start, __end, __next, t));
}
float whiteout_v_Vector3f_dot(whiteout_v_Vector3f self, whiteout_v_Vector3f other) {
const whiteout::Vector3f __self = fromC(self);
const whiteout::Vector3f __other = fromC(other);
return __self.dot(__other);
}
float whiteout_v_Vector3f_length(whiteout_v_Vector3f self) {
const whiteout::Vector3f __self = fromC(self);
return __self.length();
}
float whiteout_v_Vector3f_length_squared(whiteout_v_Vector3f self) {
const whiteout::Vector3f __self = fromC(self);
return __self.length_squared();
}
void whiteout_v_Vector3f_normalize(whiteout_v_Vector3f* self) {
whiteout::Vector3f __self = fromC(*self);
__self.normalize();
*self = toC(__self);
}
whiteout_v_Vector3f whiteout_v_Vector3f_normalized(whiteout_v_Vector3f self) {
const whiteout::Vector3f __self = fromC(self);
return toC(__self.normalized());
}
whiteout_v_Vector3f whiteout_v_Vector3f_add(whiteout_v_Vector3f self, whiteout_v_Vector3f other) {
const whiteout::Vector3f __self = fromC(self);
const whiteout::Vector3f __other = fromC(other);
return toC(__self + __other);
}
whiteout_v_Vector3f whiteout_v_Vector3f_sub(whiteout_v_Vector3f self, whiteout_v_Vector3f other) {
const whiteout::Vector3f __self = fromC(self);
const whiteout::Vector3f __other = fromC(other);
return toC(__self - __other);
}
whiteout_v_Vector3f whiteout_v_Vector3f_mul(whiteout_v_Vector3f self, whiteout_v_Vector3f other) {
const whiteout::Vector3f __self = fromC(self);
const whiteout::Vector3f __other = fromC(other);
return toC(__self * __other);
}
whiteout_v_Vector3f whiteout_v_Vector3f_div(whiteout_v_Vector3f self, whiteout_v_Vector3f other) {
const whiteout::Vector3f __self = fromC(self);
const whiteout::Vector3f __other = fromC(other);
return toC(__self / __other);
}
whiteout_v_Vector3f whiteout_v_Vector3f_mul_scalar(whiteout_v_Vector3f self, float scalar) {
const whiteout::Vector3f __self = fromC(self);
return toC(__self * scalar);
}
whiteout_v_Vector3f whiteout_v_Vector3f_div_scalar(whiteout_v_Vector3f self, float scalar) {
const whiteout::Vector3f __self = fromC(self);
return toC(__self / scalar);
}
whiteout_v_Vector3f whiteout_v_Vector3f_negate(whiteout_v_Vector3f self) {
const whiteout::Vector3f __self = fromC(self);
return toC(-__self);
}
int32_t whiteout_v_Vector3f_equals(whiteout_v_Vector3f self, whiteout_v_Vector3f other) {
const whiteout::Vector3f __self = fromC(self);
const whiteout::Vector3f __other = fromC(other);
return (__self == __other) ? 1 : 0;
}
whiteout_v_Vector3f whiteout_v_Vector3f_lerp(whiteout_v_Vector3f start, whiteout_v_Vector3f end, float t) {
const whiteout::Vector3f __start = fromC(start);
const whiteout::Vector3f __end = fromC(end);
return toC(whiteout::Vector3f::lerp(__start, __end, t));
}
whiteout_v_Vector3f whiteout_v_Vector3f_tcb_in_tangent(whiteout_v_Vector3f prev, whiteout_v_Vector3f current, whiteout_v_Vector3f next, float tension, float continuity, float bias) {
const whiteout::Vector3f __prev = fromC(prev);
const whiteout::Vector3f __current = fromC(current);
const whiteout::Vector3f __next = fromC(next);
return toC(whiteout::Vector3f::tcb_in_tangent(__prev, __current, __next, tension, continuity, bias));
}
whiteout_v_Vector3f whiteout_v_Vector3f_tcb_out_tangent(whiteout_v_Vector3f prev, whiteout_v_Vector3f current, whiteout_v_Vector3f next, float tension, float continuity, float bias) {
const whiteout::Vector3f __prev = fromC(prev);
const whiteout::Vector3f __current = fromC(current);
const whiteout::Vector3f __next = fromC(next);
return toC(whiteout::Vector3f::tcb_out_tangent(__prev, __current, __next, tension, continuity, bias));
}
whiteout_v_Vector3f whiteout_v_Vector3f_bezier_lerp(whiteout_v_Vector3f start, whiteout_v_Vector3f outtan, whiteout_v_Vector3f intan, whiteout_v_Vector3f end, float t) {
const whiteout::Vector3f __start = fromC(start);
const whiteout::Vector3f __outtan = fromC(outtan);
const whiteout::Vector3f __intan = fromC(intan);
const whiteout::Vector3f __end = fromC(end);
return toC(whiteout::Vector3f::bezier_lerp(__start, __outtan, __intan, __end, t));
}
whiteout_v_Vector3f whiteout_v_Vector3f_hermite_lerp(whiteout_v_Vector3f prev, whiteout_v_Vector3f start, whiteout_v_Vector3f end, whiteout_v_Vector3f next, float t) {
const whiteout::Vector3f __prev = fromC(prev);
const whiteout::Vector3f __start = fromC(start);
const whiteout::Vector3f __end = fromC(end);
const whiteout::Vector3f __next = fromC(next);
return toC(whiteout::Vector3f::hermite_lerp(__prev, __start, __end, __next, t));
}
float whiteout_v_Vector4f_dot(whiteout_v_Vector4f self, whiteout_v_Vector4f other) {
const whiteout::Vector4f __self = fromC(self);
const whiteout::Vector4f __other = fromC(other);
return __self.dot(__other);
}
float whiteout_v_Vector4f_length(whiteout_v_Vector4f self) {
const whiteout::Vector4f __self = fromC(self);
return __self.length();
}
float whiteout_v_Vector4f_length_squared(whiteout_v_Vector4f self) {
const whiteout::Vector4f __self = fromC(self);
return __self.length_squared();
}
void whiteout_v_Vector4f_normalize(whiteout_v_Vector4f* self) {
whiteout::Vector4f __self = fromC(*self);
__self.normalize();
*self = toC(__self);
}
whiteout_v_Vector4f whiteout_v_Vector4f_normalized(whiteout_v_Vector4f self) {
const whiteout::Vector4f __self = fromC(self);
return toC(__self.normalized());
}
whiteout_v_Vector4f whiteout_v_Vector4f_add(whiteout_v_Vector4f self, whiteout_v_Vector4f other) {
const whiteout::Vector4f __self = fromC(self);
const whiteout::Vector4f __other = fromC(other);
return toC(__self + __other);
}
whiteout_v_Vector4f whiteout_v_Vector4f_sub(whiteout_v_Vector4f self, whiteout_v_Vector4f other) {
const whiteout::Vector4f __self = fromC(self);
const whiteout::Vector4f __other = fromC(other);
return toC(__self - __other);
}
whiteout_v_Vector4f whiteout_v_Vector4f_mul(whiteout_v_Vector4f self, whiteout_v_Vector4f other) {
const whiteout::Vector4f __self = fromC(self);
const whiteout::Vector4f __other = fromC(other);
return toC(__self * __other);
}
whiteout_v_Vector4f whiteout_v_Vector4f_div(whiteout_v_Vector4f self, whiteout_v_Vector4f other) {
const whiteout::Vector4f __self = fromC(self);
const whiteout::Vector4f __other = fromC(other);
return toC(__self / __other);
}
whiteout_v_Vector4f whiteout_v_Vector4f_mul_scalar(whiteout_v_Vector4f self, float scalar) {
const whiteout::Vector4f __self = fromC(self);
return toC(__self * scalar);
}
whiteout_v_Vector4f whiteout_v_Vector4f_div_scalar(whiteout_v_Vector4f self, float scalar) {
const whiteout::Vector4f __self = fromC(self);
return toC(__self / scalar);
}
whiteout_v_Vector4f whiteout_v_Vector4f_negate(whiteout_v_Vector4f self) {
const whiteout::Vector4f __self = fromC(self);
return toC(-__self);
}
int32_t whiteout_v_Vector4f_equals(whiteout_v_Vector4f self, whiteout_v_Vector4f other) {
const whiteout::Vector4f __self = fromC(self);
const whiteout::Vector4f __other = fromC(other);
return (__self == __other) ? 1 : 0;
}
whiteout_v_Vector4f whiteout_v_Vector4f_lerp(whiteout_v_Vector4f start, whiteout_v_Vector4f end, float t) {
const whiteout::Vector4f __start = fromC(start);
const whiteout::Vector4f __end = fromC(end);
return toC(whiteout::Vector4f::lerp(__start, __end, t));
}
whiteout_v_Vector4f whiteout_v_Vector4f_tcb_in_tangent(whiteout_v_Vector4f prev, whiteout_v_Vector4f current, whiteout_v_Vector4f next, float tension, float continuity, float bias) {
const whiteout::Vector4f __prev = fromC(prev);
const whiteout::Vector4f __current = fromC(current);
const whiteout::Vector4f __next = fromC(next);
return toC(whiteout::Vector4f::tcb_in_tangent(__prev, __current, __next, tension, continuity, bias));
}
whiteout_v_Vector4f whiteout_v_Vector4f_tcb_out_tangent(whiteout_v_Vector4f prev, whiteout_v_Vector4f current, whiteout_v_Vector4f next, float tension, float continuity, float bias) {
const whiteout::Vector4f __prev = fromC(prev);
const whiteout::Vector4f __current = fromC(current);
const whiteout::Vector4f __next = fromC(next);
return toC(whiteout::Vector4f::tcb_out_tangent(__prev, __current, __next, tension, continuity, bias));
}
whiteout_v_Vector4f whiteout_v_Vector4f_bezier_lerp(whiteout_v_Vector4f start, whiteout_v_Vector4f outtan, whiteout_v_Vector4f intan, whiteout_v_Vector4f end, float t) {
const whiteout::Vector4f __start = fromC(start);
const whiteout::Vector4f __outtan = fromC(outtan);
const whiteout::Vector4f __intan = fromC(intan);
const whiteout::Vector4f __end = fromC(end);
return toC(whiteout::Vector4f::bezier_lerp(__start, __outtan, __intan, __end, t));
}
whiteout_v_Vector4f whiteout_v_Vector4f_hermite_lerp(whiteout_v_Vector4f prev, whiteout_v_Vector4f start, whiteout_v_Vector4f end, whiteout_v_Vector4f next, float t) {
const whiteout::Vector4f __prev = fromC(prev);
const whiteout::Vector4f __start = fromC(start);
const whiteout::Vector4f __end = fromC(end);
const whiteout::Vector4f __next = fromC(next);
return toC(whiteout::Vector4f::hermite_lerp(__prev, __start, __end, __next, t));
}
float whiteout_v_Quaternion_dot(whiteout_v_Quaternion self, whiteout_v_Quaternion other) {
const whiteout::Quaternion __self = fromC(self);
const whiteout::Quaternion __other = fromC(other);
return __self.dot(__other);
}
float whiteout_v_Quaternion_length(whiteout_v_Quaternion self) {
const whiteout::Quaternion __self = fromC(self);
return __self.length();
}
float whiteout_v_Quaternion_length_squared(whiteout_v_Quaternion self) {
const whiteout::Quaternion __self = fromC(self);
return __self.length_squared();
}
void whiteout_v_Quaternion_normalize(whiteout_v_Quaternion* self) {
whiteout::Quaternion __self = fromC(*self);
__self.normalize();
*self = toC(__self);
}
whiteout_v_Quaternion whiteout_v_Quaternion_normalized(whiteout_v_Quaternion self) {
const whiteout::Quaternion __self = fromC(self);
return toC(__self.normalized());
}
whiteout_v_Quaternion whiteout_v_Quaternion_add(whiteout_v_Quaternion self, whiteout_v_Quaternion other) {
const whiteout::Quaternion __self = fromC(self);
const whiteout::Quaternion __other = fromC(other);
return toC(__self + __other);
}
whiteout_v_Quaternion whiteout_v_Quaternion_sub(whiteout_v_Quaternion self, whiteout_v_Quaternion other) {
const whiteout::Quaternion __self = fromC(self);
const whiteout::Quaternion __other = fromC(other);
return toC(__self - __other);
}
whiteout_v_Quaternion whiteout_v_Quaternion_mul(whiteout_v_Quaternion self, whiteout_v_Quaternion other) {
const whiteout::Quaternion __self = fromC(self);
const whiteout::Quaternion __other = fromC(other);
return toC(__self * __other);
}
whiteout_v_Quaternion whiteout_v_Quaternion_mul_scalar(whiteout_v_Quaternion self, float scalar) {
const whiteout::Quaternion __self = fromC(self);
return toC(__self * scalar);
}
whiteout_v_Quaternion whiteout_v_Quaternion_div_scalar(whiteout_v_Quaternion self, float scalar) {
const whiteout::Quaternion __self = fromC(self);
return toC(__self / scalar);
}
whiteout_v_Quaternion whiteout_v_Quaternion_negate(whiteout_v_Quaternion self) {
const whiteout::Quaternion __self = fromC(self);
return toC(-__self);
}
int32_t whiteout_v_Quaternion_equals(whiteout_v_Quaternion self, whiteout_v_Quaternion other) {
const whiteout::Quaternion __self = fromC(self);
const whiteout::Quaternion __other = fromC(other);
return (__self == __other) ? 1 : 0;
}
whiteout_v_Quaternion whiteout_v_Quaternion_conjugate(whiteout_v_Quaternion self) {
const whiteout::Quaternion __self = fromC(self);
return toC(__self.conjugate());
}
whiteout_v_Quaternion whiteout_v_Quaternion_inverse(whiteout_v_Quaternion self) {
const whiteout::Quaternion __self = fromC(self);
return toC(__self.inverse());
}
whiteout_v_Quaternion whiteout_v_Quaternion_log(whiteout_v_Quaternion self) {
const whiteout::Quaternion __self = fromC(self);
return toC(__self.log());
}
whiteout_v_Quaternion whiteout_v_Quaternion_exp(whiteout_v_Quaternion self) {
const whiteout::Quaternion __self = fromC(self);
return toC(__self.exp());
}
whiteout_v_Vector3f whiteout_v_Quaternion_to_euler_angles(whiteout_v_Quaternion self) {
const whiteout::Quaternion __self = fromC(self);
return toC(__self.to_euler_angles());
}
whiteout_v_Vector3f whiteout_v_Quaternion_rotate_vector(whiteout_v_Quaternion self, whiteout_v_Vector3f v) {
const whiteout::Quaternion __self = fromC(self);
const whiteout::Vector3f __v = fromC(v);
return toC(__self.rotate_vector(__v));
}
whiteout_v_Quaternion whiteout_v_Quaternion_identity(void) {
return toC(whiteout::Quaternion::identity());
}
whiteout_v_Quaternion whiteout_v_Quaternion_from_axis_angle(whiteout_v_Vector3f axis, float angle_rad) {
const whiteout::Vector3f __axis = fromC(axis);
return toC(whiteout::Quaternion::from_axis_angle(__axis, angle_rad));
}
whiteout_v_Quaternion whiteout_v_Quaternion_from_euler_angles(whiteout_v_Vector3f euler_rad) {
const whiteout::Vector3f __euler_rad = fromC(euler_rad);
return toC(whiteout::Quaternion::from_euler_angles(__euler_rad));
}
whiteout_v_Quaternion whiteout_v_Quaternion_slerp(whiteout_v_Quaternion a, whiteout_v_Quaternion b, float t) {
const whiteout::Quaternion __a = fromC(a);
const whiteout::Quaternion __b = fromC(b);
return toC(whiteout::Quaternion::slerp(__a, __b, t));
}
whiteout_v_Quaternion whiteout_v_Quaternion_squad(whiteout_v_Quaternion start, whiteout_v_Quaternion outtan, whiteout_v_Quaternion inttan, whiteout_v_Quaternion end, float t) {
const whiteout::Quaternion __start = fromC(start);
const whiteout::Quaternion __outtan = fromC(outtan);
const whiteout::Quaternion __inttan = fromC(inttan);
const whiteout::Quaternion __end = fromC(end);
return toC(whiteout::Quaternion::squad(__start, __outtan, __inttan, __end, t));
}
whiteout_v_Quaternion whiteout_v_Quaternion_ln_dif(whiteout_v_Quaternion a, whiteout_v_Quaternion b) {
const whiteout::Quaternion __a = fromC(a);
const whiteout::Quaternion __b = fromC(b);
return toC(whiteout::Quaternion::ln_dif(__a, __b));
}
whiteout_v_Matrix33f whiteout_v_Matrix33f_add(whiteout_v_Matrix33f self, whiteout_v_Matrix33f other) {
const whiteout::Matrix33f __self = fromC(self);
const whiteout::Matrix33f __other = fromC(other);
return toC(__self + __other);
}
whiteout_v_Matrix33f whiteout_v_Matrix33f_sub(whiteout_v_Matrix33f self, whiteout_v_Matrix33f other) {
const whiteout::Matrix33f __self = fromC(self);
const whiteout::Matrix33f __other = fromC(other);
return toC(__self - __other);
}
whiteout_v_Matrix33f whiteout_v_Matrix33f_mul(whiteout_v_Matrix33f self, whiteout_v_Matrix33f other) {
const whiteout::Matrix33f __self = fromC(self);
const whiteout::Matrix33f __other = fromC(other);
return toC(__self * __other);
}
whiteout_v_Matrix33f whiteout_v_Matrix33f_mul_scalar(whiteout_v_Matrix33f self, float scalar) {
const whiteout::Matrix33f __self = fromC(self);
return toC(__self * scalar);
}
whiteout_v_Matrix33f whiteout_v_Matrix33f_identity(void) {
return toC(whiteout::Matrix33f::identity());
}
whiteout_v_Matrix33f whiteout_v_Matrix33f_zero(void) {
return toC(whiteout::Matrix33f::zero());
}
float whiteout_v_Matrix33f_get_at(whiteout_v_Matrix33f self, size_t row, size_t col) {
return self.data[row][col];
}
void whiteout_v_Matrix33f_set_at(whiteout_v_Matrix33f* self, size_t row, size_t col, float value) {
self->data[row][col] = value;
}
whiteout_v_Matrix44f whiteout_v_Matrix44f_add(whiteout_v_Matrix44f self, whiteout_v_Matrix44f other) {
const whiteout::Matrix44f __self = fromC(self);
const whiteout::Matrix44f __other = fromC(other);
return toC(__self + __other);
}
whiteout_v_Matrix44f whiteout_v_Matrix44f_sub(whiteout_v_Matrix44f self, whiteout_v_Matrix44f other) {
const whiteout::Matrix44f __self = fromC(self);
const whiteout::Matrix44f __other = fromC(other);
return toC(__self - __other);
}
whiteout_v_Matrix44f whiteout_v_Matrix44f_mul(whiteout_v_Matrix44f self, whiteout_v_Matrix44f other) {
const whiteout::Matrix44f __self = fromC(self);
const whiteout::Matrix44f __other = fromC(other);
return toC(__self * __other);
}
whiteout_v_Matrix44f whiteout_v_Matrix44f_mul_scalar(whiteout_v_Matrix44f self, float scalar) {
const whiteout::Matrix44f __self = fromC(self);
return toC(__self * scalar);
}
whiteout_v_Matrix44f whiteout_v_Matrix44f_identity(void) {
return toC(whiteout::Matrix44f::identity());
}
whiteout_v_Matrix44f whiteout_v_Matrix44f_zero(void) {
return toC(whiteout::Matrix44f::zero());
}
whiteout_v_Matrix44f whiteout_v_Matrix44f_translation(whiteout_v_Vector3f t) {
const whiteout::Vector3f __t = fromC(t);
return toC(whiteout::Matrix44f::translation(__t));
}
whiteout_v_Matrix44f whiteout_v_Matrix44f_rotation(whiteout_v_Quaternion q) {
const whiteout::Quaternion __q = fromC(q);
return toC(whiteout::Matrix44f::rotation(__q));
}
whiteout_v_Matrix44f whiteout_v_Matrix44f_scaling(whiteout_v_Vector3f s) {
const whiteout::Vector3f __s = fromC(s);
return toC(whiteout::Matrix44f::scaling(__s));
}
whiteout_v_Matrix44f whiteout_v_Matrix44f_compose(whiteout_v_Vector3f translation, whiteout_v_Quaternion rotation, whiteout_v_Vector3f scale) {
const whiteout::Vector3f __translation = fromC(translation);
const whiteout::Quaternion __rotation = fromC(rotation);
const whiteout::Vector3f __scale = fromC(scale);
return toC(whiteout::Matrix44f::compose(__translation, __rotation, __scale));
}
whiteout_v_Matrix44f whiteout_v_Matrix44f_inverse(whiteout_v_Matrix44f m) {
const whiteout::Matrix44f __m = fromC(m);
return toC(whiteout::Matrix44f::inverse(__m));
}
whiteout_v_Matrix44f whiteout_v_Matrix44f_rotation_x(float angle) {
return toC(whiteout::Matrix44f::rotation_x(angle));
}
whiteout_v_Matrix44f whiteout_v_Matrix44f_rotation_y(float angle) {
return toC(whiteout::Matrix44f::rotation_y(angle));
}
whiteout_v_Matrix44f whiteout_v_Matrix44f_rotation_z(float angle) {
return toC(whiteout::Matrix44f::rotation_z(angle));
}
whiteout_v_Matrix44f whiteout_v_Matrix44f_look_at_rh(whiteout_v_Vector3f eye, whiteout_v_Vector3f target, whiteout_v_Vector3f up) {
const whiteout::Vector3f __eye = fromC(eye);
const whiteout::Vector3f __target = fromC(target);
const whiteout::Vector3f __up = fromC(up);
return toC(whiteout::Matrix44f::look_at_rh(__eye, __target, __up));
}
whiteout_v_Matrix44f whiteout_v_Matrix44f_look_at_lh(whiteout_v_Vector3f eye, whiteout_v_Vector3f target, whiteout_v_Vector3f up) {
const whiteout::Vector3f __eye = fromC(eye);
const whiteout::Vector3f __target = fromC(target);
const whiteout::Vector3f __up = fromC(up);
return toC(whiteout::Matrix44f::look_at_lh(__eye, __target, __up));
}
whiteout_v_Matrix44f whiteout_v_Matrix44f_look_at_lh_sgcompat(whiteout_v_Vector3f eye, whiteout_v_Vector3f target, whiteout_v_Vector3f up) {
const whiteout::Vector3f __eye = fromC(eye);
const whiteout::Vector3f __target = fromC(target);
const whiteout::Vector3f __up = fromC(up);
return toC(whiteout::Matrix44f::look_at_lh_sgcompat(__eye, __target, __up));
}
whiteout_v_Matrix44f whiteout_v_Matrix44f_perspective_fov_rh(float fovY, float aspect, float nearZ, float farZ) {
return toC(whiteout::Matrix44f::perspective_fov_rh(fovY, aspect, nearZ, farZ));
}
whiteout_v_Matrix44f whiteout_v_Matrix44f_perspective_fov_lh(float fovY, float aspect, float nearZ, float farZ) {
return toC(whiteout::Matrix44f::perspective_fov_lh(fovY, aspect, nearZ, farZ));
}
whiteout_v_Matrix44f whiteout_v_Matrix44f_perspective_diag_sgcompat(float fovDiagonal, float aspect, float nearZ, float farZ) {
return toC(whiteout::Matrix44f::perspective_diag_sgcompat(fovDiagonal, aspect, nearZ, farZ));
}
whiteout_v_Matrix44f whiteout_v_Matrix44f_orthographic_rh(float width, float height, float nearZ, float farZ) {
return toC(whiteout::Matrix44f::orthographic_rh(width, height, nearZ, farZ));
}
whiteout_v_Matrix44f whiteout_v_Matrix44f_transpose(whiteout_v_Matrix44f self) {
const whiteout::Matrix44f __self = fromC(self);
return toC(__self.transpose());
}
whiteout_v_Vector3f whiteout_v_Matrix44f_extract_translation(whiteout_v_Matrix44f self) {
const whiteout::Matrix44f __self = fromC(self);
return toC(__self.extract_translation());
}
whiteout_v_Quaternion whiteout_v_Matrix44f_extract_rotation(whiteout_v_Matrix44f self) {
const whiteout::Matrix44f __self = fromC(self);
return toC(__self.extract_rotation());
}
whiteout_v_Vector3f whiteout_v_Matrix44f_extract_scale(whiteout_v_Matrix44f self) {
const whiteout::Matrix44f __self = fromC(self);
return toC(__self.extract_scale());
}
float whiteout_v_Matrix44f_get_at(whiteout_v_Matrix44f self, size_t row, size_t col) {
return self.data[row][col];
}
void whiteout_v_Matrix44f_set_at(whiteout_v_Matrix44f* self, size_t row, size_t col, float value) {
self->data[row][col] = value;
}
whiteout_v_Vector3f whiteout_v_cross(whiteout_v_Vector3f a, whiteout_v_Vector3f b) {
const whiteout::Vector3f __a = fromC(a);
const whiteout::Vector3f __b = fromC(b);
return toC(whiteout::cross(__a, __b));
}
whiteout_v_Vector3f whiteout_v_transform_point(whiteout_v_Vector3f v, whiteout_v_Matrix44f m) {
const whiteout::Vector3f __v = fromC(v);
const whiteout::Matrix44f __m = fromC(m);
return toC(whiteout::transform_point(__v, __m));
}
whiteout_v_Vector3f whiteout_v_transform_normal(whiteout_v_Vector3f v, whiteout_v_Matrix44f m) {
const whiteout::Vector3f __v = fromC(v);
const whiteout::Matrix44f __m = fromC(m);
return toC(whiteout::transform_normal(__v, __m));
}
uint8_t* whiteout_v_Texture_data_mut(whiteout_v_Texture* self, size_t* out_size) {
auto __s = reinterpret_cast<whiteout::textures::Texture*>(self)->data();
if (out_size) *out_size = __s.size();
return reinterpret_cast<uint8_t*>(__s.data());
}
uint8_t* whiteout_v_Texture_mipData_mut(whiteout_v_Texture* self, uint32_t mip, uint32_t layer, size_t* out_size) {
auto __s = reinterpret_cast<whiteout::textures::Texture*>(self)->mipData(mip, layer);
if (out_size) *out_size = __s.size();
return reinterpret_cast<uint8_t*>(__s.data());
}
}