src/kiss_clang_3d.c
// the naive way, applying the definition; this is quite inefficient though
the naive way, applying the definition; this is quite inefficient though
the naive way applying the definition ; this is quite inefficient though
bool rotate_by_quat(Vec3 * v, Quat const * q, F_TYPE tolerance){
    if (!quat_is_unitary(q)){
        return false;
    }
    Quat q_1;
    Quat q_2;
    Quat q_3;
    vec3_to_quat(v, &q_1);
    quat_copy(q, &q_2);
    quat_conj(&q_2);
    quat_prod(&q_1, &q_2, &q_3);
    quat_conj(&q_2);
    quat_prod(&q_2, &q_3, &q_1);
    quat_to_vec3(&q_1, v);
    return true;
}
bool rotate_by_quat ( Vec3 * v , Quat const * q , F_TYPE tolerance ) { if ( ! quat_is_unitary ( q ) ) { return false ; } Quat q_1 ; Quat q_2 ; Quat q_3 ; vec3_to_quat ( v , & q_1 ) ; quat_copy ( q , & q_2 ) ; quat_conj ( & q_2 ) ; quat_prod ( & q_1 , & q_2 , & q_3 ) ; quat_conj ( & q_2 ) ; quat_prod ( & q_2 , & q_3 , & q_1 ) ; quat_to_vec3 ( & q_1 , v ) ; return true ; }
the naive way, applying the definition; this is quite inefficient though
the naive way applying the definition ; this is quite inefficient though
// q_1 is the Quat out of v // q_2 is the rotation Quat conjugate // q_3 contains the right part of the product // q_2 is the rotation quat // q_1 contains the full quaternion // make the result available