e80e0de74ca38b50a4f28f9be4a08a5a76cf7e20
9 Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
e80e0de74c |
Programmatic Measurements (#5346)
* feat(viewer-lib): Added MeasurementData and stuck with shared library defined measurement related types * feat(viewer-lib): Some updates: - Removed unnecessary calculations in point to point measurement. More lean now. Implemented serialization/deserialization - Tempoarary serialization/deserializaton for the rest of the measurement types - MeasurementsExtension now is able to load measurements from MeasurementData objects - Updated viewer's export list to not export mesurements related types that are now exclusively exported by the shared library * feat(viewer): Perpendicular measurements simplification (a little bit) and serialization/deserialization * chore(frontend): Updated measurement types imports * chore(viewer-lib): Removed the old normal indicator line from the perpendicular measurement * feat(viewer-lib): Updates: - Generic fromMeasurementData and toMeasurementData for all measurements since it's unniversal - Each measurement type serializes/deserializes only specialized data - Implemented ponint measurement serializing/deserializing and programmatic functionining * feat(viewer-lib): Area mesurement serialization/deserialization * feat(viewer-lib): Updates: - Each measurement subtype now reports the MeasurementType it belongs to - MeasurementsExtension now emits a MeasurementsChanged event with all the measurements as payload whenever the measurements change - units and precision are no longer serialized/deserialized on a per-measurement basis - Added sync API member addMeasurement * chore(viewer-lib): Fix compiler error * chore(viewer-lib): Added measurements getter in MeasurementExtension * feat(fe2): save/reload measurements integration (#5351) * measurements idempotent api * extra adjustments, stuff seems to work * lint fix * more lint fix * fix for visible going false * better identification * fix FlyControls change action --------- Co-authored-by: Kristaps Fabians Geikins <fabians@speckle.systems> |
||
|
|
24cf8e9e63 | fix(viewer): don't trigger movement if any modifier keys are pressed | ||
|
|
920099c39f |
chore(readable code): use TIME_MS for readable durations
- we recently added TIME_MS helper; this applies it to existing durations |
||
|
|
0195f65067 | fix(viewer-lib): Implemented proper interpolation for angles which gets rid of incorrect rotation jumps while animating camera rotation (#4311) | ||
|
|
065c242ef5 |
fix(viewer-lib): Fixes two issues regarding very small scale streams (#3930)
- The orbit controller would not properly report changes in camera movement on a per frame basis becuase of a hardcoded epsilon which was not small enough for very small scenes. Now the epsilon is dynamically computed - WASD-ing would jitter in very small scenes because of a too large normalization value sent to the position dampers. Now that value is also dynamically computed for small scenes |
||
|
|
a3d1e6adec |
Orbit WASDEQ Controls (#3875)
* Updated the fly controller to use the z up basis * Fixed very important compiler error * Removed the annoying delay when first holding down WASD keys before movement started * Updated LegacyViewer to use the hybrid camera controls * Added big baker * Trying to figure out the essence of this * Partly works * Pivotal coordinates now work * Smoothened out the math abit * Fixed sandbox error * Enabled the pivot sphere * feat(viewer-lib): Fixed some issues with orbiting around cursor * feat(viewer-lib): Updates to WEB-2313, orbiting around mouse cursor Orbiting around mouse cursor now works correctly with an orthographic projection as well as when toggling between orthographic and perspective. Disabled WASD navigation for now. SmoothOrbitControls now has protected members instead of private allowing extension Documented the important parts of the pivotal navigation code * feat(viewer-lib): Mouse orbiting now takes clipping planes into consideration * chore(viewer-lib): Fixed sandbox build error * fix(viewer-lib): Handled WEB-2449 and WEB-2450 Additionally fixed an issue where changing the orbit pivot would trigger a hard render, adding the unneeded noise of AO re-convergence * fix(viewer-lib): Fixed the issue with focusing and other camera animations caused by the introduction on the pivotal CS. Pivot sphere now shows only on orbit * feat(viewer-lib): Updates on mouse orbiting: - When clicking outside of the model, oribitig will switch to polar and use the last computed origin (which is still going to be based on the last pivot point) Made the pivot sphere speckle blue The pivot sphere now only shows when clicking on objects, when clicking outside of the model it will not show * feat(viewer-lib): Update for WASD aka fly mode: - Smoother combined navigation by using the immediate controler position and orientation as opposed the the goal ones - Pivot sphere properly hides when in fly mode - The bug where the camera would incorrectly jump when toggling between fly and oribit is now gone (or I cannot reproduce it anymore) * fix(viewer-lib): Fixed sandbox compile error * feat(viewer-lib): Added the hybrid fly orbit controller to the legacy viewer * feat(viewer-lib): Added a slower movement speed to WASD navigation when camera is close to geometry * fix(viewer-lib): Fixed the issue where opening the context menu while holding down a WASD key would make the camera move indefinetely * Feat(viewer-lib): Update to WASD controls: - Disabled cursor orbiting - Added an option to allow for world space up/down with e/q keys. By default it's enabled - Fixed the pan speed to work similar to WASD speed in two steps depending how close the camera is to geometry * chore(viewer-lib): Tidied up a bit * fix(viewer-lib): Fixed an ugly bug where the camera distance calculataion plane would flip, especially when WASD-ing, and mess up the min distance calculation which led the camera near plane to be way off * chore(viewer-lib): Swapped E to up and Q to down * Re-nabled cursor orbiting |
||
|
|
3313787f16 |
fix(viewer): viewer node16 support + fixing up package.jsons (#2442)
* fix: viewer node16 support + fixing up package.jsons * lockfile fix * Removed unnecessary type augmentations. Deleted unused SpeckleCameraControls --------- Co-authored-by: AlexandruPopovici <alexandrupopoviciioan@gmail.com> |
||
|
|
254867e038 |
Dynamic Near Camera Plane (#2434)
* Added model-viewer's orbit camera control implementation. All the features from the old orbit controls are now functional with the new one * Figured out the relation between radius and fov. Added zoom decelariting when getting closer to origin. This feature was present in the old controller but lacking in this one * WIP * Added infinite zooming * First version of infinite zoom and zoom to cursor * A few improvements on zoom to cursor. Inifite zoom and zoom to cursor now work together. Simplified the implementation * Added orthographic camera functionality in the controller without hte special features * Zoom to cursor now works with orthographic projections. Switching between perspective and orthographic while keeping all functionality correct now works * Minor cleanup a ton more to come * Added controls dampening in the sandbox * Adapted frontend to the new controller plus some additional changes to the controller options in general * Implemented setting inline and polar viewers. However mosts of the time spent was dedicated into understanding why the frontend checks for changes in the camera each frame, and if it finds one forces the camera viewer to the inline one. I haven't figured out why it's doing this and it seems very wasteful. There probably is a better way of achieving the same thing * Orbit Controller now computes it;s cartesian value based on spherical in a function so it can be used in multiple places. Replaced getting the current camera position with the target camera position in frontend frame update callback as the old camera controller did * Follow mode now works properly * Sandbox fix * Disabled debug spheres * WIP on fly controls * Correct basis transformations for fly controls * Added QE up/down movement to fly controls * Minimum radius is now dynamic and accounts for scene size * Fixed an issue with zooming to cursor when infinetely zooming * Fixed inconsistencies between zooming normally and infinetely for both zooming to cursors and otherwise * Further fixing zooming to cursor when infinetely zooming * Zoom radius modulation * Fine tuning zooming radius and wheel modulation. I think I got to some defaults that seem good enough for all scene scales. * Defaulted to 30ms decau time for dampers * Added a 'tasOnly' argument in all 'intersect' variants. This will only intersect the TAS(es) and provide an intersection result. When requesting an intersection with 'firstOnly' set, onyl the first intersected TAS will be queried further and it's first intersected BAS will provide the intersection result. Conditioned zooming to cursors by needing to have any geometry under the cursor; Fixed some small issues with functions in the acceleration structures. * Restricted intersecting onyl when zooming * Geometry intersection when zooming does not affect infinetely zoom anymore, only zoom to cursor * Temporary disabled firstHitOnly * raycastFirst now works correctly in the context of tasOnly param true or false * Added dampers to the fly controls so we have consistency across various camera controller types. * Added statinary function * WIP on controls * Debuging orbit controller issues on ipad * More consolidation work on the interface for SpeckleControl and our current implementations for it * Added controller toggle-ing * Making the controllers work from immediate data * There are no more spaces left I can transform from/to. Done them all. Works fine now essentially. Just need to clean stuff up * SpeckleControls now provide an 'up' vector, and basis transformation is computed that way rather than requirig a mat4 directly. Fixed two issues with event locking on orbit and fly * More cleanup, more fixes, more grind * Controllers now have consistency in the basis they provide the position and target into. As well as the fromPositionAndTarget function. It will always be in a basis where (0,1,0) is up. This is required because certain parts of three.js assume that basis * FlyController is now properly relative-itiez * Sorted out options for both controls. Dampening is now done via options * Small fixes for frontend integration * Fixed the issue with quaternions misaligning around PI * Added consistent orthographic resizing * Fixed camera focusing when in orthographic mode * Implemented disabling/enabling rotations with the new controls. Removed PolarView since it was never used. Canonical views WIP * Made the HybridCameraController with the simplest implementation possible that seamslessly combines both camera controls. This is for testing to get an idea about how it feels. Removed zoomToCursors when not on geometry. Increased regular zoom speed * Using constants since move speed is a modifier * lock fix * Removed HybridCameraController. Increased maximum zoom. Removed toggling camera controls with Space. New way to apply canonic views, this time a correct one * Handled WEB-1102. Kept the old empiric near plane calculation. Still usable through the camera controller's options. Moved far plane calculation from SpeckleRenderer to CameraController. * Implemented a closestPointToPoint on a halfplane. This is so that the BVH gives us the closest point on the positive halfplane of the camera and the resulting minimal distance to the 0 camera plane is correct. Added fallback to empiric near plane calculation when the scene does not contain a built BVH, aka it's only points and/or lines |
||
|
|
f844b6d22e |
Viewer Navigation (#2416)
* Added model-viewer's orbit camera control implementation. All the features from the old orbit controls are now functional with the new one * Figured out the relation between radius and fov. Added zoom decelariting when getting closer to origin. This feature was present in the old controller but lacking in this one * WIP * Added infinite zooming * First version of infinite zoom and zoom to cursor * A few improvements on zoom to cursor. Inifite zoom and zoom to cursor now work together. Simplified the implementation * Added orthographic camera functionality in the controller without hte special features * Zoom to cursor now works with orthographic projections. Switching between perspective and orthographic while keeping all functionality correct now works * Minor cleanup a ton more to come * Added controls dampening in the sandbox * Adapted frontend to the new controller plus some additional changes to the controller options in general * Implemented setting inline and polar viewers. However mosts of the time spent was dedicated into understanding why the frontend checks for changes in the camera each frame, and if it finds one forces the camera viewer to the inline one. I haven't figured out why it's doing this and it seems very wasteful. There probably is a better way of achieving the same thing * Orbit Controller now computes it;s cartesian value based on spherical in a function so it can be used in multiple places. Replaced getting the current camera position with the target camera position in frontend frame update callback as the old camera controller did * Follow mode now works properly * Sandbox fix * Disabled debug spheres * WIP on fly controls * Correct basis transformations for fly controls * Added QE up/down movement to fly controls * Minimum radius is now dynamic and accounts for scene size * Fixed an issue with zooming to cursor when infinetely zooming * Fixed inconsistencies between zooming normally and infinetely for both zooming to cursors and otherwise * Further fixing zooming to cursor when infinetely zooming * Zoom radius modulation * Fine tuning zooming radius and wheel modulation. I think I got to some defaults that seem good enough for all scene scales. * Defaulted to 30ms decau time for dampers * Added a 'tasOnly' argument in all 'intersect' variants. This will only intersect the TAS(es) and provide an intersection result. When requesting an intersection with 'firstOnly' set, onyl the first intersected TAS will be queried further and it's first intersected BAS will provide the intersection result. Conditioned zooming to cursors by needing to have any geometry under the cursor; Fixed some small issues with functions in the acceleration structures. * Restricted intersecting onyl when zooming * Geometry intersection when zooming does not affect infinetely zoom anymore, only zoom to cursor * Temporary disabled firstHitOnly * raycastFirst now works correctly in the context of tasOnly param true or false * Added dampers to the fly controls so we have consistency across various camera controller types. * Added statinary function * WIP on controls * Debuging orbit controller issues on ipad * More consolidation work on the interface for SpeckleControl and our current implementations for it * Added controller toggle-ing * Making the controllers work from immediate data * There are no more spaces left I can transform from/to. Done them all. Works fine now essentially. Just need to clean stuff up * SpeckleControls now provide an 'up' vector, and basis transformation is computed that way rather than requirig a mat4 directly. Fixed two issues with event locking on orbit and fly * More cleanup, more fixes, more grind * Controllers now have consistency in the basis they provide the position and target into. As well as the fromPositionAndTarget function. It will always be in a basis where (0,1,0) is up. This is required because certain parts of three.js assume that basis * FlyController is now properly relative-itiez * Sorted out options for both controls. Dampening is now done via options * Small fixes for frontend integration * Fixed the issue with quaternions misaligning around PI * Added consistent orthographic resizing * Fixed camera focusing when in orthographic mode * Implemented disabling/enabling rotations with the new controls. Removed PolarView since it was never used. Canonical views WIP * Made the HybridCameraController with the simplest implementation possible that seamslessly combines both camera controls. This is for testing to get an idea about how it feels. Removed zoomToCursors when not on geometry. Increased regular zoom speed * Using constants since move speed is a modifier * lock fix * Removed HybridCameraController. Increased maximum zoom. Removed toggling camera controls with Space. New way to apply canonic views, this time a correct one |