OMIDIV
Base3D< TrackInfo > Class Template Referenceabstract

A base class for Standard3D and Circle3D visualizations, since they share much of the same code.
Custom subclasses can be made as well that lay out notes in unique ways. If you do that, respect GlobalScale by making any GameObjects children of this, or manually adjusting their scale. More...

Inheritance diagram for Base3D< TrackInfo >:
VisualsComponent OmidivComponent

Protected Member Functions

void Start ()
 
override void Update ()
 
virtual void SetNoteState (TrackInfo trackInfo, int noteIndex, NoteState state)
 Updates the visuals for a note at a given noteIndex of a specific trackInfo .
 
virtual void UpdateNowPlayingVisuals ()
 
override void CreateVisuals ()
 
bool TrackHasNotes (TrackInfo track)
 
bool IgnoreTrack (TrackInfo trackInfo)
 
void ResetTracks ()
 Updates the GameObjects for track objects, and other things that don't need to be changed per-note.
 
void ResetNotes (bool justColors=false)
 Updates GameObjects for note objects.
 
override void ClearVisuals ()
 
override void Restart ()
 Override this. Called when the visualization restarts (R is pressed).
 
override void MovePlay (decimal ticks, decimal microseconds)
 
virtual void DrawGeneralMidiControls (ref bool updateTracks, ref bool updateNotes)
 Draw the general controls in the MIDI Controls window for this visualization.
 
virtual void DrawIndividualTrackControls (ref TrackInfo trackInfo, ref bool updateTracks, ref bool updateNotes)
 Draw the individual controls within the tree for a track. Will be called for each track.
 
virtual void DrawNoteControls (ref bool updateTracks, ref bool updateNotes)
 Draw the controls for the "Note Controls" tree.
 
void TrackListChanged (ref bool updateTracks, ref bool updateNotes)
 Called when the track order has been changed or tracks have been enabled/disabled.
 
override void DrawGUI ()
 Override this. Use ImGui to draw most UI elements here.
 
override void WriteConfig ()
 Override this. Write to Config here.
Don't forget to include ConfigTag in your config keys.
 
override void ReadConfig ()
 Override this. Read from Config here.
Don't forget to include ConfigTag in your config keys.
 
- Protected Member Functions inherited from VisualsComponent
void CreateVisuals ()
 Create your visualization here. Happens every time visuals reload after a call to ClearVisuals.
 
void ClearVisuals ()
 Clear all created visuals here.
 
void MovePlay (decimal ticks, decimal microseconds)
 Move your visualization forward or backward (in case midi delay is adjusted).
 
override void OnEnable ()
 
override void OnDisable ()
 
override void OnDestroy ()
 
override void ReadConfig ()
 
override void WriteConfig ()
 
override void LoadVisuals ()
 Clears and creates the visuals.
 
override void DrawGUI ()
 
override void Restart ()
 Override this. Called when the visualization restarts (R is pressed).
 
- Protected Member Functions inherited from OmidivComponent
virtual void Awake ()
 
virtual void OnPlayStart ()
 Override this. Called when the visualization starts playing. May be starting from the beginning or resuming.
 
virtual void OnPlayStop ()
 Override this. Called when the visualization stops playing.
 
virtual void Reset_ ()
 Override this. Called when SceneController.OnReset is fired. LoadAudio and LoadMidi will also be called afterwards, so don't do any of that here, but do reload any other resources your component needs.
 
virtual void LoadMidi ()
 Override this. Called when the midi information needs to be loaded from the file. LoadVisuals will also be called afterwards, so don't do any of that here.
 
virtual void LoadAudio ()
 Override this. Called when the audio needs to be loaded from the file.
 

Protected Attributes

GameObject NotePrefab
 
TrackInfo[] Tracks = new TrackInfo[0]
 
float VelocityFactor = 0.75f
 
int SideCount = 4
 
uint SideCountPrev = 0
 
float NoteRotation = 0f
 
float NoteHeight = 10f
 
float NoteHSpacing = 2f
 
float PlayedAlpha = 0.05f
 
float LastTrackUpdate = -1f
 
float LastNoteUpdate = -1f
 
float LastReloadVisuals = -1f
 

Static Protected Attributes

static readonly float GlobalScale = 1/128.0f
 

Additional Inherited Members

- Public Attributes inherited from OmidivComponent
string ConfigTag = "def"
 Use this to give different instances in difference scenes different saved config.

 
- Static Public Attributes inherited from VisualsComponent
static readonly SortedList< int, Color > TrackColors = new SortedList<int, Color>()
 
- Properties inherited from VisualsComponent
bool AutoApplyChanges = true [get, set]
 Whether changes that require recreating the visualization should apply automatically (true) or manually with F6 (false).
 
- Properties inherited from OmidivComponent
static bool IsPlaying [get]
 Is the visualization currently playing.
 
static double FrameDeltaTime [get]
 Time.deltaTime when not recording, 1/recording framerate when recording. In most cases, use this instead of Time.deltaTime so that recordings work properly.
 

Detailed Description

A base class for Standard3D and Circle3D visualizations, since they share much of the same code.
Custom subclasses can be made as well that lay out notes in unique ways. If you do that, respect GlobalScale by making any GameObjects children of this, or manually adjusting their scale.

Template Parameters
TrackInfoWhat will be stored to represent information about each track.
Type Constraints
TrackInfo :Base3DTrackInfo 
TrackInfo :new() 

Member Function Documentation

◆ DrawGeneralMidiControls()

virtual void Base3D< TrackInfo >.DrawGeneralMidiControls ( ref bool updateTracks,
ref bool updateNotes )
protectedvirtual

Draw the general controls in the MIDI Controls window for this visualization.

Parameters
updateTracksSet this to true if the tracks need to be updated.
updateNotesSet this to true if the notes need to be updated.

Reimplemented in Circle3D, and Standard3D.

◆ DrawGUI()

override void Base3D< TrackInfo >.DrawGUI ( )
protectedvirtual

Override this. Use ImGui to draw most UI elements here.

Subscribe to ImGuiManager.DrawMainMenuItems to add to main menu bar menus instead of here.

Reimplemented from OmidivComponent.

◆ DrawIndividualTrackControls()

virtual void Base3D< TrackInfo >.DrawIndividualTrackControls ( ref TrackInfo trackInfo,
ref bool updateTracks,
ref bool updateNotes )
protectedvirtual

Draw the individual controls within the tree for a track. Will be called for each track.

Parameters
trackInfoThe track thats going to have its controls drawn.
updateTracksSet this to true if the tracks need to be updated.
updateNotesSet this to true if the notes need to be updated.

◆ DrawNoteControls()

virtual void Base3D< TrackInfo >.DrawNoteControls ( ref bool updateTracks,
ref bool updateNotes )
protectedvirtual

Draw the controls for the "Note Controls" tree.

Parameters
updateTracksSet this to true if the tracks need to be updated.
updateNotesSet this to true if the notes need to be updated.

Reimplemented in Standard3D.

◆ ReadConfig()

override void Base3D< TrackInfo >.ReadConfig ( )
protectedvirtual

Override this. Read from Config here.
Don't forget to include ConfigTag in your config keys.

Reimplemented from OmidivComponent.

◆ ResetNotes()

void Base3D< TrackInfo >.ResetNotes ( bool justColors = false)
abstractprotected

Updates GameObjects for note objects.

Parameters
justColorsIf true, only reset note states to NoteState.Unplayed. Otherwise, recalculate positions, meshes, etc.

◆ Restart()

override void Base3D< TrackInfo >.Restart ( )
protectedvirtual

Override this. Called when the visualization restarts (R is pressed).

Reimplemented from OmidivComponent.

◆ TrackListChanged()

void Base3D< TrackInfo >.TrackListChanged ( ref bool updateTracks,
ref bool updateNotes )
abstractprotected

Called when the track order has been changed or tracks have been enabled/disabled.

Parameters
updateTracksSet this to true if the tracks need to be updated.
updateNotesSet this to true if the notes need to be updated.

◆ Update()

override void Base3D< TrackInfo >.Update ( )
protectedvirtual

Please call base.Update() if overriding this unless you know what you're doing.

Reimplemented from VisualsComponent.

◆ WriteConfig()

override void Base3D< TrackInfo >.WriteConfig ( )
protectedvirtual

Override this. Write to Config here.
Don't forget to include ConfigTag in your config keys.

Reimplemented from OmidivComponent.

Member Data Documentation

◆ Tracks

TrackInfo [] Base3D< TrackInfo >.Tracks = new TrackInfo[0]
protected

Note: the index of a track in here may not be the same as the midi track it represents (such as if it's been reordered). See Base3DTrackInfo.midiTrack.


The documentation for this class was generated from the following file: