[skin] Add ShadedMeshOnTrack && some background helpers #485
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds a few features to make mod-charting a bit easier in USC.
ShadedMeshOnTack
- Extends ShadedMesh to allow rendering with the track's world transform. This makes it very easy to render something moving on the track itself (such as fake notes)mesh:UseGameMesh
can be called to use built in game meshes for buttons, fxbuttons, and the track itself. This also sets the length value which is used for more convenient scaling operations withmesh:ScaleToLength
I also added a few helper methods to the lua background class:
track.GetCurrentLaneXPos
- Gets the current x (relative to the track) for a given lane. This is constant unless the track is split.track.GetYPosForTime
- Gets the y value for a given timing point in the song. This makes it easy to animate meshes moving down the track, tied to a given timetrack.GetLengthForDuration
- Given a range of time (start and duration) returns a length relative to the track. This is useful for creating fake long notes, or scaling a mesh for a certain durationtrack.HideObject
- This will tell the game to not render a hit object at the given time in the given lane. This allows the background to remove notes from the track allowing them to be animated separatelyExample mod chart using these features: https://vimeo.com/560297079
I still need to add documentation, and potentially a few more values which may be convenient (such as button widths)