(settings)
| 18 | // touching the renderer (the texture atlas itself is resolved by the Mesh |
| 19 | // base class). Runs before `super()`, so it must not touch `this`. |
| 20 | function imageSize(settings) { |
| 21 | const src = settings.image ?? settings.texture; |
| 22 | if (src instanceof TextureAtlas) { |
| 23 | const texture = src.getTexture(); |
| 24 | return { w: texture.width, h: texture.height }; |
| 25 | } |
| 26 | const image = typeof src === "object" ? src : getImage(src); |
| 27 | if (!image) { |
| 28 | throw new Error("Sprite3d: '" + src + "' image/texture not found!"); |
| 29 | } |
| 30 | return { w: image.width, h: image.height }; |
| 31 | } |
| 32 | |
| 33 | /** |
| 34 | * A textured **quad in 3D space** — the 3D counterpart of {@link Sprite}, |
no test coverage detected