refactor(LayeredMaterial): migrate to TypeScript #2477
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Converted the
LayeredMaterial
class and eponymous file to TypeScript.Took this opportunity to do some internal cleanup and refactoring of things like the way the layers (or more precisely
RasterTile
s) were stored, the uniforms and defines, etc... This means the internal API for the material has changed since we now keepRasterColorTile
s and the oneRasterElevationTile
separate internally. A conveniencegetLayer
method has been provided matching the previous API for cases where the exact type ofRasterTile
is not important.Whether we should rename the "layer" fields to "tile" to match the actual data type is up for debate. I'm all for it, but I'm not aware of how dependent people might be on those names.
Also planning on making the new uniforms/defines convenience TS-specific functions available to the
PointsMaterial
class and nukingsrc/Renderer/CommonMaterial.js
out of existence in a coming PR.Motivation and Context
This PR fits into the larger motion to migrate iTowns to TypeScript.
Tested on Ubuntu 22.04.5 LTS x86_64 using Firefox 126.0.1 (64-bit)