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

fix(Composer): Safe bounding box and 3D cursor fix #327

Merged
merged 7 commits into from
Nov 8, 2022

Conversation

jwills-jdubs
Copy link
Contributor

@jwills-jdubs jwills-jdubs commented Nov 7, 2022

Overview

Push out for the 3D cursor was causing spinning and movement due to it being executed in useFrame. This is not actually necessary for the cursor due to it's visibility through objects

Helpers, most notably the Camera Helper make the scene too large and trying to focus on a camera as well as the whole scene while active will zoom incorrectly when finding the best viewing angle

Keeps the system cursor visible with 3D cursor as per UX decision for visibility at any scale and distance. The 3D cursor is a nice helper that we can improve upon later. Adding the cursor makes this non-blocking

Legal

This project is available under the Apache 2.0 License.

@jwills-jdubs jwills-jdubs requested a review from mumanity November 7, 2022 20:57
@lgtm-com
Copy link

lgtm-com bot commented Nov 7, 2022

This pull request introduces 1 alert when merging 0b26f4d6c6727f41746f3ebf97931e2fa3726d4f into 037e1a4 - view on LGTM.com

new alerts:

  • 1 for Unused variable, import, function or class

…x creation to disable taking the size of helpers which can make the scene gigantic. Also adds a system cursor with 3D cursor to not lose it in large scenes
@jwills-jdubs jwills-jdubs force-pushed the bounding-box-minus-helpers branch from 0b26f4d to b8b6556 Compare November 7, 2022 21:36
@lgtm-com
Copy link

lgtm-com bot commented Nov 7, 2022

This pull request introduces 1 alert when merging ffd73c8 into 037e1a4 - view on LGTM.com

new alerts:

  • 1 for Unused variable, import, function or class

@jwills-jdubs jwills-jdubs marked this pull request as ready for review November 7, 2022 22:46
@lgtm-com
Copy link

lgtm-com bot commented Nov 7, 2022

This pull request introduces 1 alert when merging 4bec199 into 1026cb4 - view on LGTM.com

new alerts:

  • 1 for Unused variable, import, function or class

const lineMap: Map<THREE.Object3D, THREE.Object3D> = new Map<THREE.Object3D, THREE.Object3D>();
obj.traverse((child) => {
if ((child as THREE.LineSegments).isLineSegments) {
if (child.parent) {
Copy link
Contributor

Choose a reason for hiding this comment

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

No need to nest. This can be expressed as a single if check. if (child as THREE.LineSegments).isLineSegments && child.parent) ...

});

// Severe the connection
lineMap.forEach((line) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like this should only execute after the traversal above has completed? If so, you should consider implementing a promise to avoid issues where performance is inconsistent.

const safeBoundingBox = new THREE.Box3().setFromObject(obj);

// Re-connect
lineMap.forEach((line, parent) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Same note as above. Looks like you want to have this covered with promise.

@mumanity
Copy link
Contributor

mumanity commented Nov 8, 2022

Approving as risk is minimal. Will revisit after upcoming deadline.

@jwills-jdubs jwills-jdubs merged commit a31585f into main Nov 8, 2022
@jwills-jdubs jwills-jdubs deleted the bounding-box-minus-helpers branch November 8, 2022 22:43
@github-actions github-actions bot mentioned this pull request Nov 8, 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