Fixed electric bolt, need to make less random

This commit is contained in:
Calclavia 2013-08-03 14:33:55 -04:00
parent c9780a6ac4
commit e01565f34d
2 changed files with 27 additions and 27 deletions

View file

@ -135,8 +135,9 @@ public class Vector3
if (d != 0) if (d != 0)
{ {
scale(1 / d); return scale(1 / d);
} }
return this; return this;
} }

View file

@ -62,7 +62,7 @@ public class FXElectricBolt extends EntityFX
/** By default, we do an electrical color */ /** By default, we do an electrical color */
this.segmentCount = 1; this.segmentCount = 1;
this.particleMaxAge = (3 + this.rand.nextInt(3) - 1) * 2; this.particleMaxAge = (3 + this.rand.nextInt(3) - 1);
this.complexity = 2f; this.complexity = 2f;
this.boltWidth = 0.05f; this.boltWidth = 0.05f;
this.boltLength = this.start.distance(this.end); this.boltLength = this.start.distance(this.end);
@ -311,31 +311,30 @@ public class FXElectricBolt extends EntityFX
/** /**
* Render the bolts balls. * Render the bolts balls.
*/ */
/*
* if (segment.next == null) { Vector3 roundEnd = if (segment.next == null)
* segment.end.clone().translate(segment {
* .difference.clone().normalize().scale(renderWidth)); float rx3 = (float) Vector3 roundEnd = segment.end.clone().translate(segment.difference.clone().normalize().scale(renderWidth));
* (roundEnd.x - interpPosX); float ry3 = (float) (roundEnd.y - interpPosY); float rx3 = (float) (roundEnd.x - interpPosX);
* float rz3 = (float) (roundEnd.z - interpPosZ); float ry3 = (float) (roundEnd.y - interpPosY);
* tessellator.addVertexWithUV(rx3 - diffNext.x, ry3 - diffNext.y, rz3 - float rz3 = (float) (roundEnd.z - interpPosZ);
* diffNext.z, 0.0D, 0.0D); tessellator.addVertexWithUV(rx2 - diffNext.x, ry2 - tessellator.addVertexWithUV(rx3 - diffNext.x, ry3 - diffNext.y, rz3 - diffNext.z, 0.0D, 0.0D);
* diffNext.y, rz2 - diffNext.z, 0.5D, 0.0D); tessellator.addVertexWithUV(rx2 + tessellator.addVertexWithUV(rx2 - diffNext.x, ry2 - diffNext.y, rz2 - diffNext.z, 0.5D, 0.0D);
* diffNext.x, ry2 + diffNext.y, rz2 + diffNext.z, 0.5D, 1.0D); tessellator.addVertexWithUV(rx2 + diffNext.x, ry2 + diffNext.y, rz2 + diffNext.z, 0.5D, 1.0D);
* tessellator.addVertexWithUV(rx3 + diffNext.x, ry3 + diffNext.y, rz3 + tessellator.addVertexWithUV(rx3 + diffNext.x, ry3 + diffNext.y, rz3 + diffNext.z, 0.0D, 1.0D);
* diffNext.z, 0.0D, 1.0D); } }
*
* if (segment.prev == null) { Vector3 roundEnd = if (segment.prev == null)
* segment.start.clone().difference {
* (segment.difference.clone().normalize().scale(renderWidth)); float rx3 = Vector3 roundEnd = segment.start.clone().difference(segment.difference.clone().normalize().scale(renderWidth));
* (float) (roundEnd.x - interpPosX); float ry3 = (float) (roundEnd.y - float rx3 = (float) (roundEnd.x - interpPosX);
* interpPosY); float rz3 = (float) (roundEnd.z - interpPosZ); float ry3 = (float) (roundEnd.y - interpPosY);
* tessellator.addVertexWithUV(rx1 - diffPrev.x, ry1 - diffPrev.y, rz1 - float rz3 = (float) (roundEnd.z - interpPosZ);
* diffPrev.z, 0.5D, 0.0D); tessellator.addVertexWithUV(rx3 - diffPrev.x, ry3 - tessellator.addVertexWithUV(rx1 - diffPrev.x, ry1 - diffPrev.y, rz1 - diffPrev.z, 0.5D, 0.0D);
* diffPrev.y, rz3 - diffPrev.z, 0.0D, 0.0D); tessellator.addVertexWithUV(rx3 + tessellator.addVertexWithUV(rx3 - diffPrev.x, ry3 - diffPrev.y, rz3 - diffPrev.z, 0.0D, 0.0D);
* diffPrev.x, ry3 + diffPrev.y, rz3 + diffPrev.z, 0.0D, 1.0D); tessellator.addVertexWithUV(rx3 + diffPrev.x, ry3 + diffPrev.y, rz3 + diffPrev.z, 0.0D, 1.0D);
* tessellator.addVertexWithUV(rx1 + diffPrev.x, ry1 + diffPrev.y, rz1 + tessellator.addVertexWithUV(rx1 + diffPrev.x, ry1 + diffPrev.y, rz1 + diffPrev.z, 0.5D, 1.0D);
* diffPrev.z, 0.5D, 1.0D); } }
*/
} }
} }
} }