-
-
Notifications
You must be signed in to change notification settings - Fork 35.5k
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
Box3 now supports computing minimal bounds for setFromObject #20024
Conversation
P.S. This does not support morphAttributesPosition in the same manner that BufferGeometry's bounding box computation does. It could be added if necessary. |
@WestLangley Am I supposed to do something to nudge this PR? I'm not sure exactly what the expected PR lifecycle is for this ThreeJS. |
@arikwex I added a milestone -- that should help prevent this PR from getting lost -- but I have no control over what gets merged. |
Dear @mrdoob, should I refer to you as
or
? With the help of this PR, I will be able to call you by EITHER name depending on your preference. |
/ping @Mugen87 for opinion |
Following up on discussion in #17940, a few comments: The behavior under @mrdoob had made another suggestion in #17940 (comment), for creating a new method
In terms of clarity, I might prefer that API. The downside is that it decreases performance on the existing method, with little way to communicate that to users. Brainstorming a few alternatives... // names indicating use of `geometry.boundingBox` and maximum morph target extent...
expandByObject( object, useBounds = true )
expandByObject( object, boundingBox = true )
expandByObject( object, cached = true )
expandByObject( object, useMaximumExtent = true )
// names indicating a full scan of vertex data and current morph target state...
expandByObject( object, deep = false )
expandByObject( object, exact = false )
expandByObject( object, tight = false ) It's also possible that the geometry's bounding box was computed without considering morph targets, or at a much larger or smaller size (e.g. to account for skinning bind matrices). So I think it's probably good to be explicit about use of the bounding box rather than to use a word like "tight" or "minimal". |
That one sounds good to me. As well as this one: expandByObject( object, precise = false ) |
@arikwex Sorry for the huge delay... 😬 Do you mind resolving the merge conflicts? |
Bones rattle in a deep and dark cave. A slumbering beast awakens, hungry for a bounding box. It rebases... Everything should be up-to-date and the signature for the expandByObject + setFromObject methods have been adjusted with the name |
Thanks! |
This is a draft for implementing the "minimal bounding box" idea proposed here: #17940 (comment).
I'll need to update the docs and such still, but I'd like to know if everyone's cool with the direction before going further.