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

Viewer API Improvements #2072

Merged
merged 265 commits into from
May 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
265 commits
Select commit Hold shift + click to select a range
a489809
Fix some monstrous bugs with index buffer shuffling now that we've ch…
AlexandruPopovici Aug 7, 2023
2d24fdd
Finished with the new material management approach for mesh batches. …
AlexandruPopovici Aug 8, 2023
1ec10fb
Updated LineBatch to work with the new material management approach
AlexandruPopovici Aug 9, 2023
b064491
Implemented the required draw range related changes to the point batch
AlexandruPopovici Aug 9, 2023
b0ea173
Text batche now work with the new material management
AlexandruPopovici Aug 9, 2023
30a6178
SpeckleLineMaterial and SpecklePointsMaterial are now SpeckleMaterial…
AlexandruPopovici Aug 10, 2023
4291a87
Removed eslint-disable clauses in materials where they were no longer…
AlexandruPopovici Aug 10, 2023
75bc9b9
Added the RTE define for some materials by default. It can still be o…
AlexandruPopovici Aug 10, 2023
8c684ec
Stencil outlines is now an toggle-able option for any SpeckleMaterial…
AlexandruPopovici Aug 10, 2023
8fc91f5
Implemented setting desired material for all geometry types via Rende…
AlexandruPopovici Aug 10, 2023
838c0c7
Added MaterialOptions which can be used when setting materials based …
AlexandruPopovici Aug 11, 2023
6f02a2e
Added public method for setting seletion extension options
AlexandruPopovici Aug 11, 2023
26f87ad
After some profiling, realized three.js was doing a lot of pointless …
AlexandruPopovici Aug 11, 2023
919c064
addRenderTreeAsync is now a generator. Handled automatic zooming on v…
AlexandruPopovici Aug 14, 2023
29ba128
Merge branch 'wtf' into alex/API2.0-core
AlexandruPopovici Aug 14, 2023
11e2476
Centralized RTE and shadow RTE buffer in an extended webglrenderer. T…
AlexandruPopovici Aug 14, 2023
61e397b
SpeckleMeshes now use a cached material clone as their batch material…
AlexandruPopovici Aug 15, 2023
bbf1c92
Cleaned up Materils. Updated the debug show batches function use the …
AlexandruPopovici Aug 15, 2023
4769504
Real time measurement exist now as a separate extension. Existing fun…
AlexandruPopovici Aug 16, 2023
862dd0f
Removed viewer related events from input and replaced them everywhere…
AlexandruPopovici Aug 16, 2023
c47f74d
Fixed two issues with the shadowcatcher. One was a regression introdu…
AlexandruPopovici Aug 16, 2023
fe89d17
WIP on the filtering extension
AlexandruPopovici Aug 16, 2023
5766299
FilteringExtension is done. Kept the same implementation
AlexandruPopovici Aug 17, 2023
2d4be50
Merge branch 'main' into alex/API2.0
AlexandruPopovici Aug 17, 2023
9d61876
Added filter reset function
AlexandruPopovici Aug 17, 2023
3bf17ca
Removed uniform texture and batch count binding from each material's …
AlexandruPopovici Aug 17, 2023
cac5a92
Update RenderingStats to measure CPU render time per frame.
AlexandruPopovici Aug 18, 2023
07d393d
Added early and late update functions for extensions. First gets call…
AlexandruPopovici Aug 18, 2023
95285cd
All speckle materials now use the centralized RTE data. Updated the f…
AlexandruPopovici Aug 18, 2023
84bc9ae
Added explosion extension. Additional cleanup
AlexandruPopovici Aug 18, 2023
dd62955
Dirty transforms are marked on a per batch object basis, whenever the…
AlexandruPopovici Aug 18, 2023
8b68b30
Added getObjects which returns all batch objects in the scene and get…
AlexandruPopovici Aug 21, 2023
1828294
Added setters for position, rotiation and scale in batch object
AlexandruPopovici Aug 21, 2023
c40c08c
Diff extension is complete. We stuck with creating material instances…
AlexandruPopovici Aug 21, 2023
d6c4732
RV batch materials are obtained via the viewer-core API based on the …
AlexandruPopovici Aug 21, 2023
e90b5cb
Small cleanup
AlexandruPopovici Aug 22, 2023
05384be
Removed all circular dependencies besides one, like I predicted. The …
AlexandruPopovici Aug 22, 2023
2d43dd7
Removed last circular dependency just for the sake of completion
AlexandruPopovici Aug 22, 2023
dea0ea2
Merge branch 'main' into alex/API2.0-core
AlexandruPopovici Aug 28, 2023
7d8fb35
Merge branch 'main' into alex/API2.0-core
AlexandruPopovici Aug 28, 2023
0dbeda9
SpeckleRendere now has a clipping volume which is used internally to …
AlexandruPopovici Aug 28, 2023
9361d26
Implemented the SpeckleLoader along with it's abstract supertype. Dat…
AlexandruPopovici Aug 30, 2023
ca06024
Working minimal obj loader
AlexandruPopovici Aug 30, 2023
01f2c6e
Added total node counting and displaying
AlexandruPopovici Aug 31, 2023
753bb81
Viewer's load object now takes a loader of any speckle loader base cl…
AlexandruPopovici Sep 4, 2023
58c285e
Loaders can now load from string and array buffer data where implemen…
AlexandruPopovici Sep 4, 2023
1c16379
alex/API2.0-core
AlexandruPopovici Sep 5, 2023
caa293f
Started on #1673. Fixed an issue with walkAsync where the recursive g…
AlexandruPopovici Sep 7, 2023
cd1db94
Solution for #1673. Replaced the old async pausing approach with a be…
AlexandruPopovici Sep 7, 2023
0f16598
Cut down some more on load time by using a lookup table for determine…
AlexandruPopovici Sep 20, 2023
055fd64
BoxFromObjects now returns the correctly transformed aabb
AlexandruPopovici Sep 22, 2023
20b1d02
Merged main
AlexandruPopovici Sep 26, 2023
8383fff
Merged
AlexandruPopovici Sep 28, 2023
756681a
Merge branch 'main' into alex/API2.0
AlexandruPopovici Oct 10, 2023
6b0aba1
Akward merge from main
AlexandruPopovici Oct 10, 2023
bc4cf1a
Implemented optimisations for batch building step from the loading pr…
AlexandruPopovici Oct 11, 2023
bd0c870
Implemented a NodeMap which allows us to search for nodes very very f…
AlexandruPopovici Oct 16, 2023
884d36a
Added a dynamic pause in the loader which stops the converter from bl…
AlexandruPopovici Oct 17, 2023
c4931b7
Replaced some internal walks with the newer and much faster id findin…
AlexandruPopovici Oct 20, 2023
69f9842
Disable object shallow cloning acrss the speckle converter
AlexandruPopovici Oct 20, 2023
0a6d969
Fixed the issues with block instances and revit instances caused by n…
AlexandruPopovici Oct 23, 2023
b51027c
getObjectPropertis is now async and slightly improved the execution t…
AlexandruPopovici Oct 23, 2023
27f431e
Set caching to true by default
AlexandruPopovici Oct 23, 2023
84bd7e5
Fix for display style hashing
AlexandruPopovici Oct 23, 2023
ae8dc2d
Merge branch 'main' into alex/API2.0
AlexandruPopovici Oct 24, 2023
c9f1783
Implemented legacy viewer as a wrapper around the old viewer API
AlexandruPopovici Oct 24, 2023
0846e8c
Started testing FE1 with API 2.0. Fixed some legacy issues. Also the …
AlexandruPopovici Oct 24, 2023
36f530a
Merged main
AlexandruPopovici Oct 25, 2023
da1fc7e
Updated FE1 with API2.0 selection changes
AlexandruPopovici Oct 25, 2023
48c1fb6
Fixing selection bugs
AlexandruPopovici Oct 25, 2023
04d305d
The viewer now ignores duplicate id nodes
AlexandruPopovici Oct 25, 2023
75d7ba1
Merged
AlexandruPopovici Oct 25, 2023
82242ad
Fixes to object properties population, camera zooming and adding subt…
AlexandruPopovici Oct 25, 2023
10238ff
Fixed some filtering issues. Added UpdateFlags to the viewer's reques…
AlexandruPopovici Oct 26, 2023
6a6eca1
Fixed an issue where section boxes were incorrectly added to the URL
AlexandruPopovici Oct 26, 2023
395686d
Objects with no id are not given nodes into the tree
AlexandruPopovici Oct 26, 2023
04e9178
Updates to FE2 for API2.0. Also fixed a really really obscure bug in …
AlexandruPopovici Oct 26, 2023
305c12a
We now store separate node maps for each model loaded. Each node now …
AlexandruPopovici Oct 27, 2023
e491711
Render request after updating the visual diff
AlexandruPopovici Oct 27, 2023
6fe9573
Fixed some missing update calls on shadows
AlexandruPopovici Oct 27, 2023
fa62f86
Merge branch 'main' into alex/API2.0-FE2
AlexandruPopovici Oct 30, 2023
140b9c7
Merge branch 'main' into alex/API2.0
AlexandruPopovici Oct 30, 2023
6819afd
Reverted FE1 changes and pinned the viewer library to a specific (lat…
AlexandruPopovici Oct 30, 2023
145d43c
We're adding a viewer node for loaded models as subtree parent. This …
AlexandruPopovici Oct 30, 2023
7ec4b4b
Fixed an issue where clicking on a comment bubble made the pipeline u…
AlexandruPopovici Oct 30, 2023
7d596e4
Null check for setMaterial. Fixed another case of dark blight. Hack r…
AlexandruPopovici Oct 30, 2023
f4f3893
Fixed the issue with filtering state not propagating in the FE
AlexandruPopovici Oct 31, 2023
362f2d2
Updated selection event changes
AlexandruPopovici Nov 1, 2023
1d1acf2
Fixed an issue where an undefined subtree id would yield an incorrect…
AlexandruPopovici Nov 1, 2023
ddd70a2
Fixed an issue where undefined nodes were returned as valid when sear…
AlexandruPopovici Nov 1, 2023
b2f55f0
NodeRenderView now holds it's subtree id along the speckle id. This a…
AlexandruPopovici Nov 1, 2023
daaafa8
Fixed an issue with BlockInstances not instancing underlying meshes f…
AlexandruPopovici Nov 1, 2023
995d3f8
Some fixes to diffing. Some older than API2.0, some new. Render views…
AlexandruPopovici Nov 2, 2023
47b484b
Update node render view id with guid where needed
AlexandruPopovici Nov 2, 2023
9134333
Unload function now checks for requested resource to unload before tr…
AlexandruPopovici Nov 2, 2023
16f4124
Check for the existence of a batch before applying draw ranges. Inthe…
AlexandruPopovici Nov 2, 2023
0182fad
Fixed an issue for filtering where subtree roots would cause incorrec…
AlexandruPopovici Nov 2, 2023
bbd0883
merged with main
AlexandruPopovici Nov 6, 2023
403b93a
Merge branch 'alex/API2.0-FE2' into alex/API2.0
AlexandruPopovici Nov 6, 2023
05ca05c
Unified block instance and revit instance conversion implementation
AlexandruPopovici Nov 9, 2023
2ef872d
Separted instanced from non-instanced rvs. Working on InstancedMeshBatch
AlexandruPopovici Nov 10, 2023
84b2f35
WIP on instanced types
AlexandruPopovici Nov 10, 2023
06793f0
Implemented visual for box draging
AlexandruPopovici Nov 12, 2023
741f4ad
BoxSelection extension beautified and documented along with some smal…
AlexandruPopovici Nov 14, 2023
21a3a51
Viewer's getExtension now looks in the prototype chain before returni…
AlexandruPopovici Nov 15, 2023
0b96753
Added the extended Selection extension here for possible later use
AlexandruPopovici Nov 15, 2023
d97ca02
Merged
AlexandruPopovici Nov 16, 2023
64b1c33
First iteration on instancing. General idea works. Still WIP on sever…
AlexandruPopovici Nov 17, 2023
62cd6ad
Fixed issues related to incorrect transform being calculated for inst…
AlexandruPopovici Nov 17, 2023
8694be1
Fixed a few issues with instanced vs non instanced render view gathering
AlexandruPopovici Nov 20, 2023
58d0c94
Disabled box selection extension
AlexandruPopovici Nov 20, 2023
1d8f270
Merge branch 'main' into alex/API2.0
AlexandruPopovici Nov 20, 2023
0c11861
Fixed some linter errors
AlexandruPopovici Nov 20, 2023
dd95444
Disabled a lint 'error'
AlexandruPopovici Nov 20, 2023
4ba6815
Fixed issues with depth rendering and instanced objects and fixed dra…
AlexandruPopovici Nov 21, 2023
3ffd56b
Updated the measurements extension with the visiblity option
AlexandruPopovici Nov 22, 2023
76e40a3
Restructed a bit our implementation for the acceleration structure be…
AlexandruPopovici Nov 22, 2023
20d4bbf
WIP
AlexandruPopovici Nov 22, 2023
34b67e9
Revert "WIP"
AlexandruPopovici Nov 22, 2023
9e1d10e
More WIP on trying to make instanced geometry TAS and BAS work properly
AlexandruPopovici Nov 22, 2023
57c183d
Both Tas and Bas intersection testing seem to working fine. Now we ne…
AlexandruPopovici Nov 23, 2023
671affb
Another awkward merge from main
AlexandruPopovici Nov 23, 2023
87c0cd1
Added draw group management to InstancedMeshBatch. It works in the sa…
AlexandruPopovici Nov 24, 2023
b4b4de4
Draw groups need to hold the index and count from the instanced buffe…
AlexandruPopovici Nov 24, 2023
02ae594
Added array shuffling to the instanced mesh batch using the same appr…
AlexandruPopovici Nov 25, 2023
6de0373
Instanced batches now dynamically add InstancedMesh objects based on …
AlexandruPopovici Nov 26, 2023
a956125
Applying draw range updates for instanced batches now works. Still so…
AlexandruPopovici Nov 27, 2023
6408958
Disabled some more RTE until setting visibility for draw ranges is fi…
AlexandruPopovici Nov 27, 2023
6222708
Moved getting opaque, transparent and stencil draw ranges out from Ba…
AlexandruPopovici Nov 27, 2023
a5c0855
Fixed an issue with setting the visibility ranges for instanced mesh …
AlexandruPopovici Nov 27, 2023
2f18f3d
Instanced attributes for instanced meshes now no longer allocate
AlexandruPopovici Nov 28, 2023
7274737
Shadow depth material for instances is now set in the speckle renderer
AlexandruPopovici Nov 28, 2023
9c64a43
R-enabled RTE globally. Made instancing work with RTE. Made instancin…
AlexandruPopovici Dec 4, 2023
1eb0e8e
Fixed an issue with materials building up in the mesh batch's cache i…
AlexandruPopovici Dec 5, 2023
d15ce53
Implemented gradient indexs attributes for instanced batches. Thismea…
AlexandruPopovici Dec 5, 2023
99546c8
Changed the way compound ids are created for instances, so that less …
AlexandruPopovici Dec 5, 2023
3a64e85
Implemented reseting the draw ranges for instanced mesh batches. We n…
AlexandruPopovici Dec 6, 2023
f2ffbbd
Removed references of draw groups with ids since we're not doing that…
AlexandruPopovici Dec 6, 2023
1b8f989
Merged with main
AlexandruPopovici Dec 6, 2023
7ab4935
merged
AlexandruPopovici Dec 6, 2023
efe5dd8
Several issues with selective transformations on instanced batches fi…
AlexandruPopovici Dec 6, 2023
395e93e
Added default null materials for instanced meshes both with and witho…
AlexandruPopovici Dec 6, 2023
ced88f3
Got rid of the patched InstancedMesh because it was ridiculously slow…
AlexandruPopovici Dec 6, 2023
2cd6d83
Minor, yet big regression fix
AlexandruPopovici Dec 6, 2023
1801bf5
Fixed regression
AlexandruPopovici Dec 6, 2023
3733305
Exported some extra types
AlexandruPopovici Dec 11, 2023
2f6f929
WIP on instanced balancing
AlexandruPopovici Dec 11, 2023
194fb95
Instanced objects under a certain threshold now get batched together …
AlexandruPopovici Dec 11, 2023
2f8af4c
Forgot to update the rvs aabb
AlexandruPopovici Dec 12, 2023
9045a0b
Unified instanced and non instanced batch creation. Instances which d…
AlexandruPopovici Dec 13, 2023
c285f54
Added some timing information to instanced batches
AlexandruPopovici Dec 15, 2023
65f72bd
Fixed an issue with zooming in on objects not working in the selectio…
AlexandruPopovici Dec 16, 2023
e207c0f
Merged with main
AlexandruPopovici Dec 16, 2023
9f97d24
Merged with API 2.0
AlexandruPopovici Dec 16, 2023
5b9a7e8
Removed logs
AlexandruPopovici Dec 19, 2023
aaf2836
Update stream moving via UI
AlexandruPopovici Jan 4, 2024
e5a1887
Removed the priority argument from loadObject since it's not needed a…
AlexandruPopovici Jan 6, 2024
631de58
Updated LegacyViewer
AlexandruPopovici Jan 6, 2024
2484462
Fixed an issue with API 2.0 where the legacy form of transforms with …
AlexandruPopovici Jan 8, 2024
de03239
Merge branch 'main' into alex/API2.0
AlexandruPopovici Jan 9, 2024
f3d8485
Updated FE1 viewer package to latest before API 2.0
AlexandruPopovici Jan 9, 2024
874e39d
Disabled selection when measurement mode is on
AlexandruPopovici Jan 9, 2024
8971233
Updated ibl params updating
AlexandruPopovici Jan 9, 2024
5d83fea
Fixed an issue with measurement text not showing up
AlexandruPopovici Jan 9, 2024
0fce1d7
Logs
AlexandruPopovici Jan 9, 2024
0d7b7fe
Merge branch 'main' into alex/API2.0
AlexandruPopovici Jan 10, 2024
93b93be
lockfile
AlexandruPopovici Jan 10, 2024
450d4b6
Merge branch 'main' into alex/API2.0
AlexandruPopovici Jan 10, 2024
0b31e07
Made DataTree obsolete. Removed unused 'input' property from viewer
AlexandruPopovici Jan 16, 2024
3f57b67
Fixed circular dependencies
AlexandruPopovici Jan 16, 2024
e50fd04
Removed DebugViewer, other small changes
AlexandruPopovici Jan 17, 2024
918766b
Fixed conflicts
AlexandruPopovici Jan 17, 2024
84bdeb3
Merge branch 'main' into alex/API2.0
AlexandruPopovici Jan 18, 2024
eec03b9
Merge branch 'alex/viewer-API-updates' into alex/API2.0
AlexandruPopovici Jan 18, 2024
5b202a4
Small changes
AlexandruPopovici Jan 20, 2024
2a290a7
Small fixes
AlexandruPopovici Jan 23, 2024
3e3ba44
Added id to NodeData
AlexandruPopovici Jan 23, 2024
b807ad9
Removed unused bounds property in rendertree
AlexandruPopovici Jan 23, 2024
341778e
Notes to future self + ExtendedExtension is now exported
AlexandruPopovici Jan 24, 2024
a9b5767
Removed an unused function from renderer. Removed the parent argumetn…
AlexandruPopovici Jan 24, 2024
6293934
Removed the instance type check in getRenderViewesForNode method. Sho…
AlexandruPopovici Jan 24, 2024
de96717
Removed some test code
AlexandruPopovici Jan 24, 2024
e0520f3
Small changes
AlexandruPopovici Jan 24, 2024
ec014a3
Removed pointless bounds calculation. Added note
AlexandruPopovici Jan 25, 2024
5f83cbd
Merge branch 'main' into alex/API2.0
AlexandruPopovici Jan 25, 2024
dc09a20
Added return types
AlexandruPopovici Jan 25, 2024
385bf04
Ingestigating large group operations
AlexandruPopovici Jan 26, 2024
86a30d2
Nested nodes from TreeNode are now optional. Small update to node ren…
AlexandruPopovici Feb 6, 2024
afb6e02
#1818 Remove the concept of speckle data existing behind a 'data' field
AlexandruPopovici Feb 6, 2024
3a05465
Removed unneeded property
AlexandruPopovici Feb 16, 2024
8acb75a
made arguments options in transformTRS
AlexandruPopovici Feb 16, 2024
ce47d2a
getBoundingBox from acceleration structures have an optional argument…
AlexandruPopovici Feb 22, 2024
34ea063
Several Batch methods no longer take variable numbe of arguments, but…
AlexandruPopovici Feb 22, 2024
b989577
Merged
AlexandruPopovici Feb 22, 2024
cc685e7
Added note
AlexandruPopovici Feb 29, 2024
3466496
Merged
AlexandruPopovici Mar 1, 2024
598097b
Note
AlexandruPopovici Mar 1, 2024
36f1311
Removed unused things
AlexandruPopovici Mar 4, 2024
9e4a168
Note and made the raycaster protected in intersections
AlexandruPopovici Mar 4, 2024
8e90215
Added some typings
AlexandruPopovici Mar 4, 2024
e7632ee
Replaceds some functions with accessors. Added typings. Renamed stuff
AlexandruPopovici Mar 5, 2024
6c1b917
Removed some unused properties.
AlexandruPopovici Mar 5, 2024
594c1cc
Typings for measurements
AlexandruPopovici Mar 6, 2024
9de2866
Small typing changes
AlexandruPopovici Mar 7, 2024
f562a4e
Fixed conflicts. authToken is not optional in SpeckleLoader constructor
AlexandruPopovici Mar 12, 2024
0758bf6
Merged and fixed conflicts
AlexandruPopovici Mar 28, 2024
a2d0278
Fixed the awkward conflicts
AlexandruPopovici Apr 2, 2024
a7d28d2
Fixed some more compile errors
AlexandruPopovici Apr 2, 2024
9bbd5d6
Merge branch 'main' into alex/API2.0
AlexandruPopovici Apr 5, 2024
21b8598
Merge branch 'main' into alex/API2.0
AlexandruPopovici Apr 5, 2024
260223e
Merged
AlexandruPopovici Apr 5, 2024
f1c3cb7
Merge branch 'main' into alex/API2.0
AlexandruPopovici Apr 14, 2024
099e17a
Sources from 'batching' folder are now strict compile compliant
AlexandruPopovici Apr 15, 2024
829d609
Sources from 'materials' folder are now strict compile compliant
AlexandruPopovici Apr 15, 2024
e958d87
Sources from 'extensions' folder are now strict compile compliant
AlexandruPopovici Apr 15, 2024
5b406bc
Sources from 'tree' folder are now strict compile compliant
AlexandruPopovici Apr 15, 2024
e8f1292
Viewer interface, implementation, legacy implementation and the expor…
AlexandruPopovici Apr 15, 2024
a57ba0a
Sources from 'objects' folder now comply to the strict compilation rules
AlexandruPopovici Apr 16, 2024
f0b0901
Sources from 'pipeline' now satisfy the requirements for strict compi…
AlexandruPopovici Apr 16, 2024
b484238
Sources from 'loaders' folder are now compiling with strict. That was…
AlexandruPopovici Apr 16, 2024
81dd266
Sources from 'query' folder are now compiling with strict
AlexandruPopovici Apr 16, 2024
7f5af0f
Another round of correction triggered by previous changes
AlexandruPopovici Apr 16, 2024
e90e0c5
Update the declaration file in the object loader to contain a member …
AlexandruPopovici Apr 16, 2024
ba5e0de
SpeckleRenderer along with the rest of the surces from the root 'modu…
AlexandruPopovici Apr 16, 2024
767a3fc
Completely deprecated DataTree. Updated the dependencies with @types/…
AlexandruPopovici Apr 16, 2024
8b06bf9
Fixed a failing build on the CI regarding a timeout id
AlexandruPopovici Apr 16, 2024
3cce646
Fixed compile errors from sandbox
AlexandruPopovici Apr 16, 2024
7818473
Another fix
AlexandruPopovici Apr 16, 2024
de01d1f
All EventEmiter child classes now have mapped event handler argument …
AlexandruPopovici Apr 16, 2024
bbf216d
Disabled verbatimModuleSyntax because it was messing things up. Fixed…
AlexandruPopovici Apr 17, 2024
b89f094
Fixed frontend-2 linting errors. Also added all the event payload map…
AlexandruPopovici Apr 17, 2024
5ecdb2d
Some good additions but mostly typescript catering
AlexandruPopovici Apr 17, 2024
e8ae8d9
Some more typescript catering, but also something useful. The interse…
AlexandruPopovici Apr 18, 2024
3b4fe6a
Continued from yesterday, finished with the changes in intersections.…
AlexandruPopovici Apr 19, 2024
db09233
Mostly catering to typescript
AlexandruPopovici Apr 19, 2024
9757c3b
Removed underscore and all unused dependancies. Fixed remaining lint …
AlexandruPopovici Apr 23, 2024
fca82b3
Minor changes
AlexandruPopovici Apr 24, 2024
85a5d80
Merged
AlexandruPopovici Apr 24, 2024
437d20c
Added the no-non-null assertion rule to the sandbox
AlexandruPopovici Apr 24, 2024
7cf1a59
getExtension never returns null, but rather throws an exception if re…
AlexandruPopovici Apr 25, 2024
1c4fb0f
Merged and fixed conflicts
AlexandruPopovici Apr 29, 2024
4e8c282
getBatches now returns explicit batch types based on the geometry typ…
AlexandruPopovici Apr 29, 2024
37ca3cf
Adding the lockfile
AlexandruPopovici Apr 30, 2024
0659929
undoing unnecessary FE2 changes
fabis94 May 2, 2024
836dfb7
Merged viewer/fe SpeckleObject types
fabis94 May 2, 2024
fdfe150
merged and fixed remainig issue
AlexandruPopovici May 7, 2024
7706d48
Merge branch 'alex/API2.0' of github.com:specklesystems/speckle-serve…
AlexandruPopovici May 7, 2024
5ea133c
Fixed two small issues
AlexandruPopovici May 7, 2024
277b1e5
Minor linting issues
AlexandruPopovici May 7, 2024
56e3b3d
Merge branch 'main' into alex/API2.0
AlexandruPopovici May 7, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ const { hideObjects, showObjects, isolateObjects, unIsolateObjects } =

const isAtomic = computed(() => props.treeItem.atomic === true)
const speckleData = props.treeItem?.raw as SpeckleObject
const rawSpeckleData = props.treeItem?.raw as Record<string, unknown>
const rawSpeckleData = props.treeItem?.raw as SpeckleObject

const headerAndSubheader = computed(() => {
return getHeaderAndSubheaderForSpeckleObject(rawSpeckleData)
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend-2/components/viewer/selection/Object.vue
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
class="pl-2"
>
<ViewerSelectionObject
:object="(kvp.value as Record<string,unknown>) || {}"
:object="(kvp.value as SpeckleObject) || {}"
:title="(kvp.key as string)"
:unfold="false"
/>
Expand Down
4 changes: 2 additions & 2 deletions packages/frontend-2/components/viewer/settings/Menu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ const localViewerSettings = useSynchronizedCookie<ViewerUserSettings>(
const { instance } = useInjectedViewer()

const setViewerCameraHandlerControlsMaxPolarAngle = (angle: number) => {
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
instance.getExtension(CameraController).controls.maxPolarAngle = angle
const extension = instance.getExtension(CameraController)
if (extension) extension.controls.maxPolarAngle = angle
}

const toggleTurntableMode = () => {
Expand Down
15 changes: 3 additions & 12 deletions packages/frontend-2/lib/common/helpers/sceneExplorer.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { type SpeckleObject, type SpeckleReference } from '@speckle/viewer'

// Note: minor typing hacks for less squiggly lines in the explorer.
// TODO: ask alex re viewer data tree types

Expand All @@ -10,15 +12,4 @@ export type ExplorerNode = {
children: ExplorerNode[]
}

export type SpeckleReference = {
referencedId: string
}

export interface SpeckleObject {
id?: string
elements?: SpeckleReference[]
children?: SpeckleObject[] | SpeckleReference[]
name?: string
speckle_type?: string
[key: string]: unknown
}
export type { SpeckleObject, SpeckleReference }
Original file line number Diff line number Diff line change
Expand Up @@ -306,13 +306,14 @@ function useViewerCameraIntegration() {

const loadCameraDataFromViewer = () => {
const controls = instance.getExtension(CameraController).controls
let cameraManuallyChanged = false

const viewerPos = new Vector3()
const viewerTarget = new Vector3()

controls.getPosition(viewerPos)
controls.getTarget(viewerTarget)

let cameraManuallyChanged = false
if (!areVectorsLooselyEqual(position.value, viewerPos)) {
if (hasInitialLoadFired.value) position.value = viewerPos.clone()
cameraManuallyChanged = true
Expand Down
6 changes: 3 additions & 3 deletions packages/frontend-2/lib/viewer/composables/ui.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { SpeckleViewer, timeoutAt, type Optional } from '@speckle/shared'
import { SpeckleViewer, timeoutAt } from '@speckle/shared'
import type { TreeNode } from '@speckle/viewer'
import { CameraController, MeasurementsExtension } from '@speckle/viewer'
import type { MeasurementOptions, PropertyInfo } from '@speckle/viewer'
Expand Down Expand Up @@ -64,14 +64,14 @@ export function useCameraUtilities() {
instance.setView(...args)
}

let cameraController: Optional<CameraController> = undefined
let cameraController: CameraController | null = null
const truck = (
...args: Parameters<NonNullable<typeof cameraController>['controls']['truck']>
) => {
if (!cameraController) {
cameraController = instance.getExtension(CameraController)
}
cameraController.controls.truck(...args)
cameraController?.controls.truck(...args)
}

const zoomExtentsOrSelection = () => {
Expand Down
12 changes: 6 additions & 6 deletions packages/frontend-2/lib/viewer/composables/viewer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { TimeoutError, timeoutAt } from '@speckle/shared'
import type { MaybeAsync, Nullable } from '@speckle/shared'
import { Vector3 } from 'three'
import { areVectorsLooselyEqual } from '~~/lib/viewer/helpers/three'
import { CameraController } from '@speckle/viewer'
import { CameraController, type ViewerEventPayload } from '@speckle/viewer'
import type { TreeNode } from '@speckle/viewer'
import type { SpeckleObject } from '~~/lib/common/helpers/sceneExplorer'

Expand Down Expand Up @@ -78,9 +78,9 @@ function getFirstVisibleSelectionHit(
}

// eslint-disable-next-line @typescript-eslint/no-explicit-any
export function useViewerEventListener<A = any>(
name: ViewerEvent | ViewerEvent[],
listener: (...args: A[]) => MaybeAsync<void>,
export function useViewerEventListener<K extends ViewerEvent>(
name: K | K[],
listener: (args: ViewerEventPayload[K]) => MaybeAsync<void>,
options?: Partial<{
state: InitialStateWithRequestAndResponse
}>
Expand Down Expand Up @@ -135,7 +135,8 @@ export function useViewerCameraTracker(
}

// Only invoke callback if position/target changed in a meaningful way
const controls = instance.getExtension(CameraController).controls
const extension = instance.getExtension(CameraController)
const controls = extension.controls
const viewerPos = new Vector3()
const viewerTarget = new Vector3()

Expand Down Expand Up @@ -165,7 +166,6 @@ export function useViewerCameraTracker(

onMounted(() => {
const extension = instance.getExtension(CameraController)

extension.controls.addEventListener('update', finalCallback)
})

Expand Down
2 changes: 1 addition & 1 deletion packages/objectloader/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,6 @@ export default class ObjectLoader {
): SpeckleObject | SpeckleObject[]

async *getObjectIterator(): Generator<SpeckleObject, SpeckleObject>

async getObject(id: string): Promise<Record<string, unknown>>
dispose(): void
}
3 changes: 3 additions & 0 deletions packages/viewer-sandbox/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ const config = {
parserOptions: {
sourceType: 'module'
},
rules: {
'@typescript-eslint/no-non-null-assertion': 'error'
},
overrides: [
{
files: '*.ts',
Expand Down
25 changes: 10 additions & 15 deletions packages/viewer-sandbox/src/Extensions/BoxSelection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,7 @@ import { ObjectLayers } from '@speckle/viewer'
import { NodeRenderView } from '@speckle/viewer'
import { SelectionExtension } from '@speckle/viewer'
import { BatchObject } from '@speckle/viewer'
import {
Extension,
IViewer,
GeometryType,
MeshBatch,
CameraController
} from '@speckle/viewer'
import { Extension, IViewer, GeometryType, CameraController } from '@speckle/viewer'
import {
Matrix4,
ShaderMaterial,
Expand Down Expand Up @@ -113,17 +107,18 @@ export class BoxSelection extends Extension {

/** Gets the object ids that fall withing the provided selection box */
private getSelectionIds(selectionBox: Box3) {
/** Get the renderer */
const renderer = this.viewer.getRenderer()
/** Get the mesh batches */
const batches = this.viewer
.getRenderer()
.batcher.getBatches(undefined, GeometryType.MESH) as MeshBatch[]

const batches = renderer.batcher.getBatches(undefined, GeometryType.MESH)
/** Compute the clip matrix */
const clipMatrix = new Matrix4()
clipMatrix.multiplyMatrices(
this.viewer.getRenderer().renderingCamera.projectionMatrix,
this.viewer.getRenderer().renderingCamera.matrixWorldInverse
)
if (renderer.renderingCamera) {
clipMatrix.multiplyMatrices(
renderer.renderingCamera.projectionMatrix,
renderer.renderingCamera.matrixWorldInverse
)
}

/** We're using three-mesh-bvh library for out BVH
* Go over each batch and test it against the TAS only.
Expand Down
16 changes: 9 additions & 7 deletions packages/viewer-sandbox/src/Extensions/CameraPlanes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import {
Extension,
GeometryType,
IViewer,
MeshBatch,
Vector3
} from '@speckle/viewer'
import { PerspectiveCamera } from 'three'
Expand All @@ -20,17 +19,18 @@ export class CameraPlanes extends Extension {

public constructor(viewer: IViewer) {
super(viewer)
this.camerController = viewer.getExtension(
CameraController as new () => CameraController
)
this.camerController = viewer.getExtension(CameraController) as CameraController
}

public onEarlyUpdate(): void {
this.computePerspectiveCameraPlanes()
}

public computePerspectiveCameraPlanes() {
const camera = this.viewer.getRenderer().renderingCamera as PerspectiveCamera
const renderer = this.viewer.getRenderer()
if (!renderer.renderingCamera) return

const camera = renderer.renderingCamera as PerspectiveCamera
const minDist = this.getClosestGeometryDistance(camera)
if (minDist === Number.POSITIVE_INFINITY) return

Expand All @@ -42,7 +42,7 @@ export class CameraPlanes extends Extension {
1 +
Math.pow(Math.tan(((fov / 180) * Math.PI) / 2), 2) * (Math.pow(aspect, 2) + 1)
)
this.viewer.getRenderer().renderingCamera.near = nearPlane
renderer.renderingCamera.near = nearPlane
console.log(minDist, nearPlane)
}

Expand All @@ -55,11 +55,13 @@ export class CameraPlanes extends Extension {

const batches = this.viewer
.getRenderer()
.batcher.getBatches(undefined, GeometryType.MESH) as MeshBatch[]
.batcher.getBatches(undefined, GeometryType.MESH)
let minDist = Number.POSITIVE_INFINITY
const minPoint = new Vector3()
for (let b = 0; b < batches.length; b++) {
const result = batches[b].mesh.TAS.closestPointToPoint(cameraPosition)
if (!result) continue

const planarity = cameraDir.dot(
new Vector3().subVectors(result.point, cameraPosition).normalize()
)
Expand Down
8 changes: 6 additions & 2 deletions packages/viewer-sandbox/src/Extensions/ExtendedSelection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,14 @@ export class ExtendedSelection extends SelectionExtension {
}

private initGizmo() {
const rendeder = this.viewer.getRenderer()
if (!rendeder.renderingCamera)
throw new Error('Cannot use ExtendedSelection without a rendering camera')

/** Create a new TransformControls gizmo */
this.transformControls = new TransformControls(
this.viewer.getRenderer().renderingCamera,
this.viewer.getRenderer().renderer.domElement
rendeder.renderingCamera,
rendeder.renderer.domElement
)
/** The gizmo creates an entire hierarchy of children internally,
* and three.js objects do not inherit parent layer values, so
Expand Down
Loading