mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-23 03:32:19 +00:00
Renderer contract: model nodes behind a modelNodes capability, with a conformance check
ModelItem.nodes had no conformance check. A renderer that poses a model's named glTF nodes now lists modelNodes (the Cesium port does); one without it draws the model as authored. The check draw.models.nodes moves the harness model's node off the screen's centre through nodes, live, ignores a name the model lacks, and gives the node its authored pose back when it leaves the map; it runs on the Cesium harness (141 passed, 0 failed) and on the stub, whose model is one node named after its file. Each harness names its model's node (assets.modelNode).
This commit is contained in:
1 parent
808941d973
commit
2c9a268694
12 files changed
+137
-4
No files matched your search
@@ -82,6 +82,7 @@ export const CESIUM_CHECKS = new Set([
|
||||
'draw.models',
|
||||
'draw.shapes.lit',
|
||||
'draw.models.loadFailed',
|
||||
'draw.models.nodes',
|
||||
'draw.models.tint',
|
||||
'draw.models.blend',
|
||||
'draw.models.update',
|
||||
@@ -194,6 +195,7 @@ function nextFrame() {
|
||||
export function createCesiumHarness({
|
||||
name = 'cesium',
|
||||
model,
|
||||
modelNode,
|
||||
missingModel,
|
||||
cameraController,
|
||||
} = {}) {
|
||||
@@ -266,6 +268,7 @@ export function createCesiumHarness({
|
||||
? {
|
||||
assets: {
|
||||
model,
|
||||
...(modelNode ? { modelNode } : {}),
|
||||
missingModel,
|
||||
// The model's bytes, for the check that a model drawn from them
|
||||
// never fetches its url.
|
||||
|
||||
@@ -73,6 +73,8 @@ export function cesiumCapabilities(scene, only) {
|
||||
// Cesium scatters drawn models through the atmosphere wherever the
|
||||
// scene draws fog (its models' atmosphere stage).
|
||||
'modelAtmosphere',
|
||||
// A model item's nodes, written to the model's runtime nodes.
|
||||
'modelNodes',
|
||||
'quads',
|
||||
'meshes',
|
||||
// Raster shells; other field kinds are refused.
|
||||
|
||||
@@ -33,7 +33,14 @@ test('capabilities follow what the scene supports', () => {
|
||||
'vectorBase',
|
||||
];
|
||||
const globe = { show: true };
|
||||
const draw = ['models', 'modelAtmosphere', 'quads', 'meshes', 'fields'];
|
||||
const draw = [
|
||||
'models',
|
||||
'modelAtmosphere',
|
||||
'modelNodes',
|
||||
'quads',
|
||||
'meshes',
|
||||
'fields',
|
||||
];
|
||||
assert.deepEqual(cesiumCapabilities({}), [...draw, ...effects]);
|
||||
// A scene with a globe reads its visibility back.
|
||||
assert.deepEqual(cesiumCapabilities({ globe }), [
|
||||
|
||||
Reference in new issue
Block a user