1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Modernize code: very last fixes (#6290)

Last modernization fixes
This commit is contained in:
Loïc Blot 2017-08-20 19:37:29 +02:00 committed by GitHub
parent c8d3d11339
commit ae9b5e0098
31 changed files with 428 additions and 523 deletions

View file

@ -106,10 +106,6 @@ Particle::Particle(
updateVertices();
}
Particle::~Particle()
{
}
void Particle::OnRegisterSceneNode()
{
if (IsVisible)
@ -227,17 +223,16 @@ void Particle::updateVertices()
0, 0, 0, 0, m_color, tx0, ty0);
v3s16 camera_offset = m_env->getCameraOffset();
for(u16 i=0; i<4; i++)
{
for (video::S3DVertex &vertex : m_vertices) {
if (m_vertical) {
v3f ppos = m_player->getPosition()/BS;
m_vertices[i].Pos.rotateXZBy(atan2(ppos.Z-m_pos.Z, ppos.X-m_pos.X)/core::DEGTORAD+90);
vertex.Pos.rotateXZBy(atan2(ppos.Z-m_pos.Z, ppos.X-m_pos.X)/core::DEGTORAD+90);
} else {
m_vertices[i].Pos.rotateYZBy(m_player->getPitch());
m_vertices[i].Pos.rotateXZBy(m_player->getYaw());
vertex.Pos.rotateYZBy(m_player->getPitch());
vertex.Pos.rotateXZBy(m_player->getYaw());
}
m_box.addInternalPoint(m_vertices[i].Pos);
m_vertices[i].Pos += m_pos*BS - intToFloat(camera_offset, BS);
m_box.addInternalPoint(vertex.Pos);
vertex.Pos += m_pos*BS - intToFloat(camera_offset, BS);
}
}
@ -285,8 +280,6 @@ ParticleSpawner::ParticleSpawner(IGameDef *gamedef, LocalPlayer *player,
}
}
ParticleSpawner::~ParticleSpawner() {}
void ParticleSpawner::step(float dtime, ClientEnvironment* env)
{
m_time += dtime;