mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-12-02 17:08:00 +01:00
Add more etherial effects to the runes particle
This commit is contained in:
parent
92fea6d349
commit
547b5f8c63
1 changed files with 27 additions and 21 deletions
|
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue