mirror of
https://github.com/isledecomp/isle.git
synced 2025-10-23 00:14:22 +00:00
Fix float constants and conversions (#1279)
* Fix legoplants warnings, add BETA10 references * Fix warnings in various header files, improve match * Fix floats in legoactors.cpp * Fix `legolocations.cpp` * fix typo --------- Co-authored-by: jonschz <jonschz@users.noreply.github.com>
This commit is contained in:
@@ -204,7 +204,7 @@ inline void Matrix4::ToQuaternion(Vector4& p_outQuat)
|
||||
{
|
||||
float trace = m_data[0][0] + m_data[1][1] + m_data[2][2];
|
||||
if (trace > 0) {
|
||||
trace = sqrt(trace + 1.0);
|
||||
trace = (float) sqrt(trace + 1.0);
|
||||
p_outQuat[3] = trace * 0.5f;
|
||||
trace = 0.5f / trace;
|
||||
p_outQuat[0] = (m_data[2][1] - m_data[1][2]) * trace;
|
||||
@@ -228,7 +228,8 @@ inline void Matrix4::ToQuaternion(Vector4& p_outQuat)
|
||||
int next = rotateIndex[largest];
|
||||
int nextNext = rotateIndex[next];
|
||||
|
||||
float trace = sqrt(*Element(largest, largest) - (*Element(nextNext, nextNext) + *Element(next, next)) + 1.0);
|
||||
float trace =
|
||||
(float) (sqrt(*Element(largest, largest) - (*Element(nextNext, nextNext) + *Element(next, next)) + 1.0));
|
||||
|
||||
p_outQuat[largest] = trace * 0.5f;
|
||||
trace = 0.5f / trace;
|
||||
@@ -276,14 +277,14 @@ inline int Matrix4::FromQuaternion(const Vector4& p_vec)
|
||||
m_data[1][2] = v24 - v13;
|
||||
m_data[2][2] = 1.0f - (v18 + v17);
|
||||
|
||||
m_data[3][0] = 0;
|
||||
m_data[3][1] = 0;
|
||||
m_data[3][2] = 0;
|
||||
m_data[3][0] = 0.0f;
|
||||
m_data[3][1] = 0.0f;
|
||||
m_data[3][2] = 0.0f;
|
||||
m_data[3][3] = 1.0f;
|
||||
|
||||
m_data[0][3] = 0;
|
||||
m_data[1][3] = 0;
|
||||
m_data[2][3] = 0;
|
||||
m_data[0][3] = 0.0f;
|
||||
m_data[1][3] = 0.0f;
|
||||
m_data[2][3] = 0.0f;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user