-
Notifications
You must be signed in to change notification settings - Fork 303
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(core): allow layer to specify which elements should be updatable
Some layers use separated objects for metadata and drawable objects. For instance PointCloudProvider or 3dTilesProvider. Attached layers (e.g texture layers) expect to receive a drawable object, in their update function. So this commit adds an optional metadataToElements function to layers, allowing them to returns the to-be-updated object from metadata, and its parent.
- Loading branch information
Showing
11 changed files
with
230 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* global describe, it */ | ||
import assert from 'assert'; | ||
import { Group, Mesh } from 'three'; | ||
import { getObjectToUpdateForAttachedLayers } from '../src/Provider/3dTilesProvider'; | ||
|
||
describe('getObjectToUpdateForAttachedLayers', function () { | ||
it('should correctly return all children', function () { | ||
const layer = { }; | ||
const tile = { | ||
content: new Group(), | ||
layer, | ||
}; | ||
|
||
for (let i = 0; i < 3; i++) { | ||
const mesh = new Mesh(); | ||
mesh.layer = layer; | ||
tile.content.add(mesh); | ||
} | ||
|
||
const result = getObjectToUpdateForAttachedLayers(tile); | ||
assert.ok(Array.isArray(result.elements)); | ||
assert.ok(result.elements.length, 3); | ||
}); | ||
}); |
Oops, something went wrong.