(property, classProperty, index)
| 435 | } |
| 436 | |
| 437 | function 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 | |
| 464 | function set(property, index, value) { |
| 465 | if (requiresUnpackForSet(property, index, value)) { |
no test coverage detected
searching dependent graphs…