mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Fix last performance-type-promotion-in-math-fn problems
This commit is contained in:
parent
a90d27e1e2
commit
8e0b80aa36
11 changed files with 59 additions and 42 deletions
|
@ -18,6 +18,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
*/
|
||||
|
||||
#include "particles.h"
|
||||
#include <cmath>
|
||||
#include "client.h"
|
||||
#include "collision.h"
|
||||
#include "client/clientevent.h"
|
||||
|
@ -227,7 +228,8 @@ void Particle::updateVertices()
|
|||
for (video::S3DVertex &vertex : m_vertices) {
|
||||
if (m_vertical) {
|
||||
v3f ppos = m_player->getPosition()/BS;
|
||||
vertex.Pos.rotateXZBy(atan2(ppos.Z-m_pos.Z, ppos.X-m_pos.X)/core::DEGTORAD+90);
|
||||
vertex.Pos.rotateXZBy(std::atan2(ppos.Z - m_pos.Z, ppos.X - m_pos.X) /
|
||||
core::DEGTORAD + 90);
|
||||
} else {
|
||||
vertex.Pos.rotateYZBy(m_player->getPitch());
|
||||
vertex.Pos.rotateXZBy(m_player->getYaw());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue