MCPcopy
hub / github.com/CesiumGS/cesium / getArrayValues

Function getArrayValues

packages/engine/Source/Scene/MetadataTableProperty.js:437–462  ·  view source on GitHub ↗
(property, classProperty, index)

Source from the content-addressed store, hash-verified

435}
436
437function getArrayValues(property, classProperty, index) {
438 let offset;
439 let length;
440 if (classProperty.isVariableLengthArray) {
441 offset = property._arrayOffsets.get(index);
442 length = property._arrayOffsets.get(index + 1) - offset;
443
444 // for vectors and matrices, the offset and length need to be multiplied
445 // by the component count
446 const componentCount = MetadataType.getComponentCount(classProperty.type);
447 offset *= componentCount;
448 length *= componentCount;
449 } else {
450 const arrayLength = classProperty.arrayLength ?? 1;
451 const componentCount = arrayLength * property._vectorComponentCount;
452 offset = index * componentCount;
453 length = componentCount;
454 }
455
456 const values = new Array(length);
457 for (let i = 0; i < length; i++) {
458 values[i] = property._getValue(offset + i);
459 }
460
461 return values;
462}
463
464function set(property, index, value) {
465 if (requiresUnpackForSet(property, index, value)) {

Callers 2

getFunction · 0.85
unpackValuesFunction · 0.85

Calls 1

getMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…