You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bug: bottom beam height is not correctly calculated #5
else if (beam.stemHeight != Beam.unspecifiedStemHeight)
{
// beam contains notes at different heights, used the calculated stem height
stemHeight = Mathf.Abs(stemHeight);
}
then it changes to
Not sure if the Mathf.Abs is needed there anymore. Also, simple notes do not seem to have this problem. I tested various systems after this change and it seems to work correctly now (although bottom stems are tiny bit longer).
I am not going to create PR because I have too many modifications.
Hey, thanks for submitting a fix for this issue! I did a little digging and it looks like the height issue you mentioned can be fixed by changing the line in question to:
else if (beam.stemHeight != Beam.unspecifiedStemHeight)
{
// beam contains notes at different heights, used the calculated stem height
stemHeight = Mathf.Abs(stemHeight - Beam.beamHeight);
}
All the other test renders look good. That being said, I dont think the rendering in this case is 100% correct. The middle stem height should be extended to create a linear beam. I will look into that and see if I can come up with a fix, and get this merged into main
Thanks for the reply. Bit of a side question, why don't beams use LineRenderer but custom procedural mesh? Was it problematic or any other particular reason? I want to change the colors of the beams (gradient), so instead of implementing custom vertex coloring I might as well rewrite it to LineRenderer, so I am asking if you stumbled on some problems.
Edit: nevermind, I realized that LineRenderer won't work so easily, because it has slanted ends.
I found out that the line should probably look like this stemHeight = Mathf.Abs(beam.stemHeight - stemPos.y);
Similarly for the chords pointing upwards. This fixes almost all cases, however some still remain.
Consider system:
Activity
matthewcpp commentedon Dec 9, 2024
Hey, thanks for submitting a fix for this issue! I did a little digging and it looks like the height issue you mentioned can be fixed by changing the line in question to:
Note: this will require you to make Beam.beamHeight public.
All the other test renders look good. That being said, I dont think the rendering in this case is 100% correct. The middle stem height should be extended to create a linear beam. I will look into that and see if I can come up with a fix, and get this merged into main
EpsilonD3lta commentedon Dec 9, 2024
Thanks for the reply. Bit of a side question, why don't beams use LineRenderer but custom procedural mesh? Was it problematic or any other particular reason? I want to change the colors of the beams (gradient), so instead of implementing custom vertex coloring I might as well rewrite it to LineRenderer, so I am asking if you stumbled on some problems.
Edit: nevermind, I realized that LineRenderer won't work so easily, because it has slanted ends.
EpsilonD3lta commentedon Dec 13, 2024
I found out that the line should probably look like this
stemHeight = Mathf.Abs(beam.stemHeight - stemPos.y);Similarly for the chords pointing upwards. This fixes almost all cases, however some still remain.
Consider system:
Result

The middle beam is slightly bent, and the right secondary beam is completely wrong.