| 173 | } |
| 174 | |
| 175 | void SpawnHelicalLaser(const Vector3& origin, const Vector3& target) |
| 176 | { |
| 177 | constexpr auto SEGMENT_COUNT_MAX = 128; |
| 178 | constexpr auto COLOR = Vector4(0.0f, 0.375f, 1.0f, 1.0f); |
| 179 | constexpr auto LENGTH_MAX = BLOCK(4); |
| 180 | constexpr auto ROT = ANGLE(-10.0f); |
| 181 | constexpr auto ELECTRICITY_FLAGS = (int)ElectricityFlags::ThinIn | (int)ElectricityFlags::ThinOut; |
| 182 | |
| 183 | auto laser = HelicalLaser(); |
| 184 | |
| 185 | laser.NumSegments = SEGMENT_COUNT_MAX; |
| 186 | laser.Origin = origin; |
| 187 | laser.Target = target; |
| 188 | laser.Orientation2D = Random::GenerateAngle(); |
| 189 | laser.LightPosition = origin; |
| 190 | laser.Color = COLOR; |
| 191 | laser.Life = HELICAL_LASER_LIFE_MAX; |
| 192 | laser.Radius = 0.0f; |
| 193 | laser.Length = LENGTH_MAX / 2; |
| 194 | laser.LengthEnd = LENGTH_MAX; |
| 195 | laser.Opacity = 1.0f; |
| 196 | laser.Rotation = ROT; |
| 197 | |
| 198 | HelicalLasers.push_back(laser); |
| 199 | |
| 200 | SpawnElectricity(origin, target, 1, 0, laser.Color.x * UCHAR_MAX, laser.Color.z * UCHAR_MAX, 20, ELECTRICITY_FLAGS, 19, 5); |
| 201 | SpawnElectricity(origin, target, 1, 110, 255, 250, 20, ELECTRICITY_FLAGS, 4, 5); |
| 202 | SpawnElectricityGlow(laser.LightPosition, 0, 0, (laser.Color.x / 2) * UCHAR_MAX, (laser.Color.z / 2) * UCHAR_MAX); |
| 203 | } |
| 204 | |
| 205 | void UpdateHelicalLasers() |
| 206 | { |
no test coverage detected