Files
neoLegacy/Minecraft.Client/FallingDustParticle.cpp
T
Tranqlmao ff562d1644 TU46 Test content and patches
TU46 Test content, added missing commits by amending commit and cherry-picking to new branch, ready for iggy guis and tu46 bug fixes
2026-10-22 13:55:39 -04:00

39 lines
918 B
C++

#include "stdafx.h"
#include "FallingDustParticle.h"
#include "../Minecraft.World/Level.h"
#include "../Minecraft.World/Mth.h"
FallingDustParticle::FallingDustParticle(Level *level, double x, double y, double z, float r, float g, float b) : Particle(level, x, y, z)
{
xd = 0;
yd = 0;
zd = 0;
rCol = r;
gCol = g;
bCol = b;
size *= 0.75f;
size *= 0.9f;
baseSize = size;
lifetime = static_cast<int>(floor(32.0f / (random->nextFloat() * 0.8f + 0.2f) * 0.9f));
setMiscTex(7);
}
void FallingDustParticle::render(Tesselator *t, float a, float xa, float ya, float za, float xa2, float za2)
{
size = baseSize * Mth::clamp((age + a) / lifetime * 32.0f, 0.0f, 1.0f);
Particle::render(t, a, xa, ya, za, xa2, za2);
}
void FallingDustParticle::tick()
{
xo = x;
yo = y;
zo = z;
if (age++ >= lifetime) remove();
setMiscTex(7 - age * 8 / lifetime);
move(xd, yd, zd);
yd -= 0.003;
if (yd < -0.14) yd = -0.14;
}