Skip to content

note_arc

Anthony Samms edited this page Jun 2, 2026 · 1 revision

A NoteArc draws a Bezier curve arc that connects a special note (drumroll, balloon, or kusudama) from its hit position back along the note lane, giving the player a visual path to follow. player keeps active instances in draw_arc_list and removes them when is_finished() returns true.

NoteArc

Construction

NoteArc(NoteType note_type, double current_ms, PlayerNum player_num, bool big, bool is_balloon,
        float start_x = 0, float start_y = 0);
Parameter Description
note_type Note type; selects the arc colour
current_ms Song timestamp when the arc begins
player_num Which player; affects the arc's screen position
big Whether the note is a big note (thicker arc)
is_balloon Whether this is a balloon arc (different shape)
start_x/y Optional custom start position for the arc origin

Public members

Member Type Description
note_type NoteType Type of note this arc belongs to
is_big bool Whether this is a big-note arc

Private members

Member Type Description
is_balloon bool Balloon arcs use a different curve shape
arc_points int Number of points sampled along the Bezier curve
arc_duration int Duration over which the arc travels (ms)
current_progress float Normalised progress (0–1) along the arc
start_ms double Timestamp when the arc started
start_x/y float Arc origin (note head position)
end_x/y float Arc destination (judgment zone)
control_x/y float Bezier control point; determines the curve shape
arc_points_cache const vector<pair<int,int>>* Pointer into the static cache of pre-computed pixel coordinates
_arc_points_cache static unordered_map<CacheKey, ...> Class-level cache keyed by arc geometry; avoids re-computation

CacheKey

A struct that uniquely identifies an arc by its six geometry floats and point count. It is hashed and compared via CacheKeyHash and operator== for use in the static cache.

Methods

void update(double current_ms);

Advances current_progress based on elapsed time since start_ms.

void draw(float y, ray::Shader mask_shader);

Iterates the cached Bezier points and draws each segment of the arc. The mask_shader is applied for rainbow balloon arcs.

bool is_finished() const;

Returns true when current_progress >= 1.0.

Clone this wiki locally