Add Formatting (Thank God)
This commit is contained in:
@@ -172,13 +172,13 @@ class ParticleColumn {
|
||||
|
||||
generatePoints() {
|
||||
for (let layer = 0; layer < this.layerCount; layer++) {
|
||||
let layerRadius = this.radius - layer;
|
||||
const layerRadius = this.radius - layer;
|
||||
for (let point = 0; point < this.pointsPerLayer; point++) {
|
||||
let angle = (point / this.pointsPerLayer) * (Math.PI * 2);
|
||||
const angle = (point / this.pointsPerLayer) * (Math.PI * 2);
|
||||
this.anglePerLayer.push(angle);
|
||||
let x = Math.cos(angle) * layerRadius;
|
||||
let z = Math.sin(angle) * layerRadius;
|
||||
let y = layer;
|
||||
const x = Math.cos(angle) * layerRadius;
|
||||
const z = Math.sin(angle) * layerRadius;
|
||||
const y = layer;
|
||||
this.points.push(Vector3Add(this.pos, vector3(x, y, z)));
|
||||
}
|
||||
}
|
||||
@@ -186,20 +186,17 @@ class ParticleColumn {
|
||||
|
||||
update() {
|
||||
//update each point by increasing the angle by the speed
|
||||
let layerCount = 0;
|
||||
let pointCount = 0;
|
||||
this.tickCounter++;
|
||||
if (this.tickCounter % 2 == 0) {
|
||||
this.points.forEach((point, index) => {
|
||||
let layer = Math.floor(index / this.pointsPerLayer);
|
||||
const layer = Math.floor(index / this.pointsPerLayer);
|
||||
let angle = this.anglePerLayer[index];
|
||||
angle += this.speed * (layer / 5);
|
||||
this.anglePerLayer[index] = angle;
|
||||
let layerRadius = this.radius - Math.floor(index / this.pointsPerLayer);
|
||||
let calcAngle = angle;
|
||||
let x = Math.cos(calcAngle) * this.radius;
|
||||
let z = Math.sin(calcAngle) * this.radius;
|
||||
let y = Math.floor(index / this.pointsPerLayer) + (this.tickCounter % 2);
|
||||
const calcAngle = angle;
|
||||
const x = Math.cos(calcAngle) * this.radius;
|
||||
const z = Math.sin(calcAngle) * this.radius;
|
||||
const y = Math.floor(index / this.pointsPerLayer) + (this.tickCounter % 2);
|
||||
this.points[index] = Vector3Add(this.pos, vector3(x, y, z));
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user