Тестирование производительности: версоры + матрица + поворот
This commit is contained in:
parent
5d4472150b
commit
a30629df67
3 changed files with 78 additions and 4 deletions
|
|
@ -7,6 +7,16 @@ const BgFP32Versor BG_FP32_IDLE_VERSOR = { 1.0f, 0.0f, 0.0f, 0.0f };
|
|||
|
||||
const BgFP64Versor BG_FP64_IDLE_VERSOR = { 1.0, 0.0, 0.0, 0.0 };
|
||||
|
||||
void __bg_fp32_versor_normalize(const float square_modulus, __BgFP32DarkTwinVersor* twin)
|
||||
{
|
||||
const float multiplier = sqrtf(1.0f / square_modulus);
|
||||
|
||||
twin->s0 *= multiplier;
|
||||
twin->x1 *= multiplier;
|
||||
twin->x2 *= multiplier;
|
||||
twin->x3 *= multiplier;
|
||||
}
|
||||
|
||||
// =============== Set Crude Turn =============== //
|
||||
|
||||
void bg_fp32_versor_set_crude_turn(const float x1, const float x2, const float x3, const float angle, const angle_unit_t unit, BgFP32Versor* result)
|
||||
|
|
|
|||
|
|
@ -408,6 +408,8 @@ static inline void bg_fp64_versor_set_inverted_fp32(const BgFP32Versor* versor,
|
|||
|
||||
// ================ Combination ================= //
|
||||
|
||||
__declspec(noinline) void __bg_fp32_versor_normalize(const float square_modulus, __BgFP32DarkTwinVersor* twin);
|
||||
|
||||
static inline void bg_fp32_versor_combine(const BgFP32Versor* second, const BgFP32Versor* first, BgFP32Versor* result)
|
||||
{
|
||||
const float s0 = (second->s0 * first->s0 - second->x1 * first->x1) - (second->x2 * first->x2 + second->x3 * first->x3);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue