15 const float mul =
dot(p, v_plane_n);
16 return p - v_plane_n * mul;
28 if (
dot(tproj, axis) < 0.0f) {
42 rotation = rotation_in;
53 rotation_axis =
cross(old_axis,
float3(1.0f, 0.0f, 0.0f));
56 rotation_axis =
cross(old_axis,
float3(0.0f, 1.0f, 0.0f));
61 const float angle = factor * full_angle;
78 if (
all(
equal(local_main_axis, local_pivot_axis))) {
80 rotation = rotation_in;
84 rotation = rotation_in;
93 if (full_angle >
M_PI) {
95 full_angle -= 2.0f *
M_PI;
98 const float angle = factor * full_angle;
SIMD_FORCE_INLINE btScalar angle(const btVector3 &v) const
Return the angle between this and another vector.
VecBase< float, D > normalize(VecOp< float, D >) RET
float dot(VecOp< float, D >, VecOp< float, D >) RET
bool all(VecOp< bool, D >) RET
VecBase< float, 3 > cross(VecOp< float, 3 >, VecOp< float, 3 >) RET
VecBase< bool, D > equal(VecOp< T, D >, VecOp< T, D >) RET
float3 project_plane_normalized_v3_v3v3(float3 p, float3 v_plane)
float angle_signed_on_axis_v3v3_v3(float3 v1, float3 v2, float3 axis)
void align_rotation_to_vector_fixed_pivot(float4 rotation_in, float factor, float3 input_vector, float3 local_main_axis, float3 local_pivot_axis, float4 &rotation)
void align_rotation_to_vector_auto_pivot(float4 rotation_in, float factor, float3 input_vector, float3 local_main_axis, float4 &rotation)
float3 transform_point_by_quaternion(Quaternion q, float3 v)
Quaternion math_quaternion_multiply(Quaternion a, Quaternion b)
Quaternion to_quaternion(EulerXYZ eul)
float angle_normalized(VecT v1, VecT v2)
static Quaternion from_float4(float4 v)