mirror of
https://github.com/minetest/irrlicht.git
synced 2025-06-28 22:36:09 +02:00
Fix ifs clang-format didn’t get
This commit is contained in:
@ -685,8 +685,7 @@ inline void SColorHSL::fromRGB(const SColorf &color)
|
||||
inline void SColorHSL::toRGB(SColorf &color) const
|
||||
{
|
||||
const f32 l = Luminance / 100;
|
||||
if (core::iszero(Saturation)) // grey
|
||||
{
|
||||
if (core::iszero(Saturation)) { // grey
|
||||
color.set(l, l, l);
|
||||
return;
|
||||
}
|
||||
|
@ -1518,8 +1518,7 @@ inline CMatrix4<T> &CMatrix4<T>::buildProjectionMatrixPerspectiveFovRH(
|
||||
// M[14]
|
||||
M[15] = 0;
|
||||
|
||||
if (zClipFromZero) // DirectX version
|
||||
{
|
||||
if (zClipFromZero) { // DirectX version
|
||||
M[10] = (T)(zFar / (zNear - zFar));
|
||||
M[14] = (T)(zNear * zFar / (zNear - zFar));
|
||||
} else // OpenGL version
|
||||
@ -1564,8 +1563,7 @@ inline CMatrix4<T> &CMatrix4<T>::buildProjectionMatrixPerspectiveFovLH(
|
||||
// M[14]
|
||||
M[15] = 0;
|
||||
|
||||
if (zClipFromZero) // DirectX version
|
||||
{
|
||||
if (zClipFromZero) { // DirectX version
|
||||
M[10] = (T)(zFar / (zFar - zNear));
|
||||
M[14] = (T)(-zNear * zFar / (zFar - zNear));
|
||||
} else // OpenGL version
|
||||
@ -1727,8 +1725,7 @@ inline CMatrix4<T> &CMatrix4<T>::buildProjectionMatrixPerspectiveRH(
|
||||
// M[14]
|
||||
M[15] = 0;
|
||||
|
||||
if (zClipFromZero) // DirectX version
|
||||
{
|
||||
if (zClipFromZero) { // DirectX version
|
||||
M[10] = (T)(zFar / (zNear - zFar));
|
||||
M[14] = (T)(zNear * zFar / (zNear - zFar));
|
||||
} else // OpenGL version
|
||||
@ -1771,8 +1768,7 @@ inline CMatrix4<T> &CMatrix4<T>::buildProjectionMatrixPerspectiveLH(
|
||||
// M[14] = (T)(zNear*zFar/(zNear-zFar));
|
||||
M[15] = 0;
|
||||
|
||||
if (zClipFromZero) // DirectX version
|
||||
{
|
||||
if (zClipFromZero) { // DirectX version
|
||||
M[10] = (T)(zFar / (zFar - zNear));
|
||||
M[14] = (T)(zNear * zFar / (zNear - zFar));
|
||||
} else // OpenGL version
|
||||
|
@ -577,8 +577,7 @@ inline quaternion &quaternion::slerp(quaternion q1, quaternion q2, f32 time, f32
|
||||
angle *= -1.0f;
|
||||
}
|
||||
|
||||
if (angle <= (1 - threshold)) // spherical interpolation
|
||||
{
|
||||
if (angle <= (1 - threshold)) { // spherical interpolation
|
||||
const f32 theta = acosf(angle);
|
||||
const f32 invsintheta = reciprocal(sinf(theta));
|
||||
const f32 scale = sinf(theta * (1.0f - time)) * invsintheta;
|
||||
@ -692,11 +691,9 @@ inline core::quaternion &quaternion::rotationFromTo(const vector3df &from, const
|
||||
v1.normalize();
|
||||
|
||||
const f32 d = v0.dotProduct(v1);
|
||||
if (d >= 1.0f) // If dot == 1, vectors are the same
|
||||
{
|
||||
if (d >= 1.0f) { // If dot == 1, vectors are the same
|
||||
return makeIdentity();
|
||||
} else if (d <= -1.0f) // exactly opposite
|
||||
{
|
||||
} else if (d <= -1.0f) { // exactly opposite
|
||||
core::vector3df axis(1.0f, 0.f, 0.f);
|
||||
axis = axis.crossProduct(v0);
|
||||
if (axis.getLength() == 0) {
|
||||
|
Reference in New Issue
Block a user