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