-
Notifications
You must be signed in to change notification settings - Fork 6
chara_3d
Chara3D renders and animates the 3D Don-chan model. It loads a costume .glb model, applies a shared animation set, and handles per-frame bone updates and face expression changes.
An enum identifying each animation by logical name. Every animation has a mirrored counterpart (e.g. DON_NORMAL_MIRROR) used for P2.
| Value | Description |
|---|---|
DON_NORMAL |
Idle loop, beat-synced |
DON_SABI |
Sabi (chorus) idle loop |
DON_GENERAL_LOOP |
Generic looping animation |
DON_GENERAL_JUMP |
Jump, plays once then returns to previous loop |
DON_MISS |
Miss reaction, plays once |
DON_MISS6 |
>= 6 miss reaction, plays once |
DON_MISS_NORMAL |
Normal-mode miss, plays once |
DON_COMBO |
Combo milestone, plays once |
DON_FULL_COMBO |
Full combo, plays once |
DON_FULL_GAGE |
Full gauge, plays once |
DON_BIND |
Bind animation, plays once |
DON_FUKKATU_START |
Revival start, plays once |
DON_FUKKATU_LOOP |
Revival loop |
DON_BALLOON_LOOP |
Balloon hit loop (double BPM) |
DON_BALLOON_SUCCESS |
Balloon cleared, plays once |
DON_BALLOON_FAILURE |
Balloon failed, plays once |
DON_BALLOON_NOBEAT |
Balloon with no beat, loop |
DON_ENTRY_IN |
Entry screen entrance, plays once |
DON_ENTRY_LOOP |
Entry screen idle loop |
DON_SELECT_LOOP |
Song select idle loop |
DON_SELECT_PANELUP |
Panel sliding up, plays once |
DON_SELECT_PANELDOWN |
Panel sliding down, plays once |
DON_NORM_UP |
Norm up, plays once |
DON_NORM_DOWN |
Norm down, plays once |
DON_NORM_LOOP |
Norm loop |
Chara3D(std::string& model_name, bool mirror = false);Loads the costume model from Skins/<skin>/Models/cos/<model_name>.glb and the shared animation set from Models/animations.glb. Re-indexes animation bones to match the costume skeleton, applies default Don colors, loads face textures from Models/face/, and loads face animations from Graphics/global/animation.json. Sets the initial animation to DON_NORMAL.
| Member | Type | Description |
|---|---|---|
mirror |
bool |
Whether the model is horizontally mirrored (used for P2) |
void set_body_texture(fs::path& texture_path);Replaces the body texture on the RGB_don_color material.
void set_face_rim_texture(fs::path& texture_path);Replaces the face rim texture on the don_FACEHIP material.
void set_don_colors(ray::Color body, ray::Color face, ray::Color rim);Recolors all materials tagged taikoEffectChangeColors in the .glb by mapping the red, green, and blue pixel channels to the provided body, face, and rim colors respectively.
void set_bpm(float bpm);Sets the BPM used to pace animation frames. The idle and sabi loops run at one beat per three frames; the balloon loop runs at double speed.
void set_anim(AnimIndex idx);Switches to the given animation from the next update. Non-looping animations automatically return to the previous looping animation when they finish. Also updates the face expression animation.
int get_anim_count() const;
std::string get_anim_name(int idx);Returns the number of loaded animations and the name of animation at index idx.
void update(double current_ms);Advances the skeleton animation by one frame when enough time has elapsed based on BPM. Applies the face expression texture when the face animation advances.
void draw(float x, float y);Draws the model at the given screen position. Renders an outline pass first using a custom shader (back-face culled, depth disabled), then renders the main model with depth testing enabled.
Building
libs
- animation
- audio
- config
- filesystem
- global_data
- input
- logging
- ray
- scores
- screen
- script
- song_parser
- text
- texture
- video
- webcam
libs/parsers
objects
objects/game
- player
- background
- gauge
- judgment
- combo
- branch_indicator
- ending_animations
- gogo_time
- fireworks
- song_info
- transition
- result_transition
- judge_counter
- score_counter
- score_counter_animation
- balloon_counter
- drumroll_counter
- kusudama_counter
- drum_hit_effect
- lane_hit_effect
- gauge_hit_effect
- combo_announce
- note_arc
objects/global
objects/title
objects/entry
objects/settings
objects/result
objects/song_select
- player
- navigator
- box_base
- box_song
- box_folder
- neiro
- modifier
- ura_switch
- diff_sort
- search_box
- dan_transition
- genre_bg
- score_history
- song_select_script
scenes