Добавление арифметических операций для дуальных чисел, векторов и кватернионов
This commit is contained in:
parent
b0b064de5a
commit
57280ac3f3
9 changed files with 179 additions and 56 deletions
|
|
@ -268,22 +268,22 @@ inline void bgc_fp64_vector3_get_mean3(BGC_FP64_Vector3* mean, const BGC_FP64_Ve
|
|||
|
||||
// =================== Linear =================== //
|
||||
|
||||
inline void bgc_fp32_vector3_interpolate(BGC_FP32_Vector3* interpolation, const BGC_FP32_Vector3* vector1, const BGC_FP32_Vector3* vector2, const float phase)
|
||||
inline void bgc_fp32_vector3_interpolate(BGC_FP32_Vector3* interpolation, const BGC_FP32_Vector3* first, const BGC_FP32_Vector3* second, const float phase)
|
||||
{
|
||||
const float counter_phase = 1.0f - phase;
|
||||
|
||||
interpolation->x1 = vector1->x1 * counter_phase + vector2->x1 * phase;
|
||||
interpolation->x2 = vector1->x2 * counter_phase + vector2->x2 * phase;
|
||||
interpolation->x3 = vector1->x3 * counter_phase + vector2->x3 * phase;
|
||||
interpolation->x1 = first->x1 * counter_phase + second->x1 * phase;
|
||||
interpolation->x2 = first->x2 * counter_phase + second->x2 * phase;
|
||||
interpolation->x3 = first->x3 * counter_phase + second->x3 * phase;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_vector3_interpolate(BGC_FP64_Vector3* interpolation, const BGC_FP64_Vector3* vector1, const BGC_FP64_Vector3* vector2, const double phase)
|
||||
inline void bgc_fp64_vector3_interpolate(BGC_FP64_Vector3* interpolation, const BGC_FP64_Vector3* first, const BGC_FP64_Vector3* second, const double phase)
|
||||
{
|
||||
const double counter_phase = 1.0 - phase;
|
||||
|
||||
interpolation->x1 = vector1->x1 * counter_phase + vector2->x1 * phase;
|
||||
interpolation->x2 = vector1->x2 * counter_phase + vector2->x2 * phase;
|
||||
interpolation->x3 = vector1->x3 * counter_phase + vector2->x3 * phase;
|
||||
interpolation->x1 = first->x1 * counter_phase + second->x1 * phase;
|
||||
interpolation->x2 = first->x2 * counter_phase + second->x2 * phase;
|
||||
interpolation->x3 = first->x3 * counter_phase + second->x3 * phase;
|
||||
}
|
||||
|
||||
// ================== Negative ================== //
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue