-
Notifications
You must be signed in to change notification settings - Fork 60
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
Conversation
This pull request introduces 1 alert when merging 0b26f4d6c6727f41746f3ebf97931e2fa3726d4f into 037e1a4 - view on LGTM.com new alerts:
|
…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
0b26f4d
to
b8b6556
Compare
This pull request introduces 1 alert when merging ffd73c8 into 037e1a4 - view on LGTM.com new alerts:
|
This pull request introduces 1 alert when merging 4bec199 into 1026cb4 - view on LGTM.com new alerts:
|
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) { |
There was a problem hiding this comment.
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) => { |
There was a problem hiding this comment.
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) => { |
There was a problem hiding this comment.
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.
Approving as risk is minimal. Will revisit after upcoming deadline. |
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.