* Return the paired normal-map texture for the given region, or `null` * if no normal map was provided to this atlas. The normal map shares * the same UV layout as the color texture returned by TextureAtlas#getTexture. * @param {object} [region] - region name in case of multipack textu
(region)
| 345 | * @returns {HTMLImageElement|HTMLCanvasElement|OffscreenCanvas|ImageBitmap|null} |
| 346 | */ |
| 347 | getNormalTexture(region) { |
| 348 | if (this.normalSources.size === 0) { |
| 349 | return null; |
| 350 | } |
| 351 | if (typeof region === "object" && typeof region.texture === "string") { |
| 352 | return this.normalSources.get(region.texture) ?? null; |
| 353 | } |
| 354 | return this.normalSources.get(this.activeAtlas) ?? null; |
| 355 | } |
| 356 | |
| 357 | /** |
| 358 | * add a region to the atlas |
no test coverage detected