Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[skin] Add ShadedMeshOnTrack && some background helpers #485

Merged
merged 5 commits into from
Jul 16, 2021

Conversation

itszn
Copy link
Collaborator

@itszn itszn commented Jun 10, 2021

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)
    • The class also holds an position and a scale vector which are applied before rendering to simplify object movement
    • 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 with mesh: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 time
  • track.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 duration
  • track.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 separately

Example 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)

@itszn itszn marked this pull request as ready for review July 16, 2021 16:36
@Drewol Drewol merged commit c168b09 into develop Jul 16, 2021
@Drewol Drewol deleted the feat/meshontrack branch November 21, 2021 13:28
Hoshikara added a commit to Hoshikara/unnamed-sdvx-clone that referenced this pull request May 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants