feat(Sprite3d): add originPoint anchor support#1538
Open
asadullahbro wants to merge 1 commit into
Open
Conversation
Adds a settings.originPoint option (preset string or {x,y}) so the
quad's pivot can be placed anywhere relative to pos, e.g. bottom-center
for ground-anchored 2.5D characters. Baked as a constant local offset
applied after flips, so it composes with billboarding and
trimmed/rotated atlas frames. Default stays centered — no behavior
change for existing code.
Updated the billboard example to anchor the character at its feet
instead of using a manual GY offset fudge factor.
Closes melonjs#1514
Member
|
Hi, Thanks for the PR, before merging I'm gonna make some further changes however that I think makes it a better fit with the legacy/existing API :
|
Author
|
@obiot thanks for the detailed feedback! Happy to implement this myself, just let me know if you'd rather I push these changes, or if you're planning to handle it on your end. Either way works for me. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Adds a settings.originPoint option (preset string or {x,y}) so the quad's pivot can be placed anywhere relative to pos, e.g. bottom-center for ground-anchored 2.5D characters. Baked as a constant local offset applied after flips, so it composes with billboarding and trimmed/rotated atlas frames. Default stays centered — no behavior change for existing code.
Updated the billboard example to anchor the character at its feet instead of using a manual GY offset fudge factor.
Closes #1514
Description
Type of change
Checklist
pnpm lintpasses)pnpm testpasses)pnpm build)Related issues