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

Library/Nature: Implement WaterSurfaceFinder #317

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

MonsterDruide1
Copy link
Owner

@MonsterDruide1 MonsterDruide1 commented Jan 27, 2025

Small helper class to locate the nearest water surface looking down from the given actor. Sadly, because updateLocal is not matching, none of the other functions for updating the result matches either.

https://decomp.me/scratch/zHEdm


This change is Reviewable

@MonsterDruide1 MonsterDruide1 self-assigned this Jan 27, 2025
Copy link
Contributor

@tetraxile tetraxile left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unfortunate :( i wasn't able to make it any better either. hopefully someone will figure this out

Reviewed 4 of 4 files at r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @MonsterDruide1)


lib/al/Library/Nature/WaterSurfaceFinder.cpp line 17 at r1 (raw file):

// NON_MATCHING: storing {0,0,0} if no surface was found (https://decomp.me/scratch/zHEdm)
void WaterSurfaceFinder::updateLocal(const sead::Vector3f& position, const sead::Vector3f& gravity,
                                     f32 distance, bool flat, bool displacement, bool overGround) {

should these names begin with an is? as in, isFlat, isDisplacement, isOverGround?

Copy link
Owner Author

@MonsterDruide1 MonsterDruide1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As this example is pretty isolated, I could also do

__asm("add x8, x19, #0xc");
__asm("str wzr, [x8, #0x18]");
__asm("str xzr, [x8]");
__asm("stp xzr, xzr, [x8, #8]");

... but honestly, I prefer mismatching a couple of functions rather than introducing stuff like that.

Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @tetraxile)


lib/al/Library/Nature/WaterSurfaceFinder.cpp line 17 at r1 (raw file):

Previously, tetraxile wrote…

should these names begin with an is? as in, isFlat, isDisplacement, isOverGround?

Yes, that sounds better - also renamed distance => maxDistance, while we're at it.

Copy link
Contributor

@tetraxile tetraxile left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, i'd agree. i think it's a slippery slope once you start doing things like that, and it defeats the purpose of the decomp.
:lgtm:

Reviewed 2 of 2 files at r2, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @MonsterDruide1)

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