(i, count)
| 136 | } |
| 137 | |
| 138 | function createGalaxy(i, count) { |
| 139 | // Galaxy parameters |
| 140 | const numArms = 4; // Number of spiral arms |
| 141 | const armWidth = 0.15; // Width of each arm (0-1) |
| 142 | const maxRadius = 40; // Maximum radius of the galaxy |
| 143 | const thickness = 5; // Vertical thickness |
| 144 | const twistFactor = 2.5; // How much the arms twist |
| 145 | |
| 146 | // Determine which arm this particle belongs to |
| 147 | const armIndex = i % numArms; |
| 148 | const indexInArm = Math.floor(i / numArms) / Math.floor(count / numArms); |
| 149 | |
| 150 | // Calculate radial distance from center |
| 151 | const radialDistance = indexInArm * maxRadius; |
| 152 | |
| 153 | // Add some randomness for arm width |
| 154 | const randomOffset = (Math.random() * 2 - 1) * armWidth; |
| 155 | |
| 156 | // Calculate angle with twist that increases with distance |
| 157 | const armOffset = (2 * Math.PI / numArms) * armIndex; |
| 158 | const twistAmount = twistFactor * indexInArm; |
| 159 | const angle = armOffset + twistAmount + randomOffset; |
| 160 | |
| 161 | // Add height variation that decreases with distance from center |
| 162 | const verticalPosition = (Math.random() * 2 - 1) * thickness * (1 - indexInArm * 0.8); |
| 163 | |
| 164 | return new THREE.Vector3( |
| 165 | Math.cos(angle) * radialDistance, |
| 166 | verticalPosition, |
| 167 | Math.sin(angle) * radialDistance |
| 168 | ); |
| 169 | } |
| 170 | |
| 171 | function createWave(i, count) { |
| 172 | // Wave/ocean parameters |
nothing calls this directly
no outgoing calls
no test coverage detected