next = positions.front();
positions.pop();
+ dir = Vector3Normalize(center - next);
dir = Vector3Normalize(Vector3{call_js_get_random() * 2.0F - 1.0F,
call_js_get_random() * 2.0F - 1.0F,
- call_js_get_random() * 2.0F - 1.0F});
+ call_js_get_random() * 2.0F - 1.0F} +
+ dir);
auto coll = GetRayCollisionSphere(Ray{.position = next, .direction = dir},
center, radius);
+ if (coll.distance > CYLINDER_LINE_MAX_LENGTH) {
+ coll.point =
+ next + Vector3Normalize(coll.point - next) * CYLINDER_LINE_MAX_LENGTH;
+ }
+
cylinders.push_back(Cylinder{.start = next, .end = coll.point});
dir = Vector3Normalize(center - coll.point);
constexpr int CYLINDER_SIDES = 3;
constexpr float CYLINDER_MAX_RADIUS = 0.03F;
constexpr float CYLINDER_EDGE_OFFSET = 0.01F;
+constexpr float CYLINDER_LINE_MAX_LENGTH = 1.5F;
class ElectricityEffect {
public:
constexpr float SURFACE_RESET_TIME_TRI_DRAW = 3.0F;
constexpr float SURFACE_RESET_Y_OFFSET = 40.0F;
-constexpr int ELECTRICITY_EFFECT_LINE_COUNT = 50;
+constexpr int ELECTRICITY_EFFECT_LINE_COUNT = 35;
class TRunnerScreen : public Screen {
public: