Добавление сферической интерполяции, переход от применения acos к применению atan2, исправление ошибок

This commit is contained in:
Andrey Pokidov 2025-03-17 09:56:56 +07:00
parent f06b35ae34
commit 9d7011e81e
17 changed files with 558 additions and 134 deletions

View file

@ -223,14 +223,14 @@ inline void bgc_versor_shorten_fp32(const BgcVersorFP32* versor, BgcVersorFP32*
_BgcDarkTwinVersorFP32* twin = (_BgcDarkTwinVersorFP32*)shortened;
if (versor->s0 >= 0.0f) {
twin->x1 = versor->s0;
twin->s0 = versor->s0;
twin->x1 = versor->x1;
twin->x2 = versor->x2;
twin->x3 = versor->x3;
return;
}
twin->x1 = -versor->s0;
twin->s0 = -versor->s0;
twin->x1 = -versor->x1;
twin->x2 = -versor->x2;
twin->x3 = -versor->x3;
@ -241,14 +241,14 @@ inline void bgc_versor_shorten_fp64(const BgcVersorFP64* versor, BgcVersorFP64*
_BgcDarkTwinVersorFP64* twin = (_BgcDarkTwinVersorFP64*)shortened;
if (versor->s0 >= 0.0) {
twin->x1 = versor->s0;
twin->s0 = versor->s0;
twin->x1 = versor->x1;
twin->x2 = versor->x2;
twin->x3 = versor->x3;
return;
}
twin->x1 = -versor->s0;
twin->s0 = -versor->s0;
twin->x1 = -versor->x1;
twin->x2 = -versor->x2;
twin->x3 = -versor->x3;
@ -362,6 +362,12 @@ inline void bgc_versor_exclude_fp64(const BgcVersorFP64* base, const BgcVersorFP
);
}
// ============ Sphere Interpolation ============ //
void bgc_versor_spherically_interpolate_fp32(const BgcVersorFP32* start, const BgcVersorFP32* end, const float phase, BgcVersorFP32* result);
void bgc_versor_spherically_interpolate_fp64(const BgcVersorFP64* start, const BgcVersorFP64* end, const double phase, BgcVersorFP64* result);
// ================ Get Rotation ================ //
void bgc_versor_get_rotation_fp32(const BgcVersorFP32* versor, BgcRotation3FP32* result);