Add more etherial effects to the runes particle

This commit is contained in:
Sollace 2022-09-11 23:32:20 +02:00
parent 92fea6d349
commit 547b5f8c63

View file

@ -106,8 +106,9 @@ public class RunesParticle extends OrientedBillboardParticle implements Attachme
float angle = MathHelper.lerp(tickDelta, prevRotationAngle, rotationAngle);
for (int i = 0; i < TEXTURES.length; i++) {
for (int dim = 0; dim < 3; dim++) {
RenderSystem.setShaderTexture(0, TEXTURES[i]);
RenderSystem.setShaderColor(red, green, blue, alpha);
RenderSystem.setShaderColor(red, green, blue, alpha / ((float)(dim * 3) + 1));
Vec3f[] corners = new Vec3f[]{
new Vec3f(-1, -1, 0),
@ -120,10 +121,14 @@ public class RunesParticle extends OrientedBillboardParticle implements Attachme
float ringSpeed = (i % 2 == 0 ? i : -1) * i;
Quaternion ringAngle = Vec3f.POSITIVE_Z.getDegreesQuaternion(angle * ringSpeed);
Quaternion ringFlip = Vec3f.POSITIVE_Y.getDegreesQuaternion(angle * ringSpeed * dim);
Quaternion ringRoll = Vec3f.POSITIVE_X.getDegreesQuaternion(angle * ringSpeed * dim);
for(int k = 0; k < 4; ++k) {
Vec3f corner = corners[k];
corner.rotate(ringAngle);
corner.rotate(ringFlip);
corner.rotate(ringRoll);
corner.rotate(rotation);
corner.scale(scale);
corner.add(x, y + 0.001F, z);
@ -132,6 +137,7 @@ public class RunesParticle extends OrientedBillboardParticle implements Attachme
renderQuad(te, buffer, corners, alpha, tickDelta);
}
}
}
@Override
public void tick() {
@ -151,7 +157,7 @@ public class RunesParticle extends OrientedBillboardParticle implements Attachme
baseSize++;
}
prevRotationAngle = rotationAngle;
rotationAngle = MathHelper.wrapDegrees(rotationAngle + 0.3F);
rotationAngle = (rotationAngle + 0.3F) % 360;
prevRotationAngle = rotationAngle - 0.3F;
}
}