Selaa lähdekoodia

Rename to ImageCubeTexture to EquirectangularCubeTexture

Dennis Dervisis 6 vuotta sitten
vanhempi
commit
065f27d1b9

+ 1 - 1
dist/preview release/what's new.md

@@ -132,7 +132,7 @@
 - Skinned meshes now behave as intended by glTF ([bghgary](https://github.com/bghgary))
   - Skinned meshes now set an override mesh instead of reparenting to the `__root__` transform node
   - Loaded bones are linked with the transform node created for the corresponding glTF node
-- Add `ImageCubeTexture` class to enable the usage of browser-canvas supported images as `CubeTexture`'s ([Dennis Dervisis](https://github.com/ddervisis))
+- Add `EquirectangularCubeTexture` class to enable the usage of browser-canvas supported images as `CubeTexture`'s ([Dennis Dervisis](https://github.com/ddervisis))
 
 ### glTF Serializer
 

+ 11 - 11
src/Materials/Textures/imageCubeTexture.ts

@@ -1,14 +1,14 @@
 import { PanoramaToCubeMapTools } from '../../Misc/HighDynamicRange/panoramaToCubemap';
 import { Engine } from "../../Engines/engine";
-import { BaseTexture } from '../../Materials/Textures/baseTexture';
-import { Texture } from '../../Materials/Textures/texture';
+import { BaseTexture } from './baseTexture';
+import { Texture } from './texture';
 import { Scene } from "../../scene";
 import { Nullable } from "../../types";
 
 /**
  * This represents a texture coming from an image supported by the web browser canvas.
  */
-export class ImageCubeTexture extends BaseTexture {
+export class EquirectangularCubeTexture extends BaseTexture {
     /** The six faces of the cube. */
     private static _FacesMapping = ['right', 'left', 'up', 'down', 'front', 'back'];
 
@@ -35,7 +35,7 @@ export class ImageCubeTexture extends BaseTexture {
     public coordinatesMode = Texture.CUBIC_MODE;
 
     /**
-     * Instantiates an ImageCubeTexture from the following parameters.
+     * Instantiates an EquirectangularCubeTexture from the following parameters.
      * @param url The location of the image
      * @param scene The scene the texture will be used in
      * @param size The cubemap desired size (the more it increases the longer the generation will be)
@@ -122,7 +122,7 @@ export class ImageCubeTexture extends BaseTexture {
 
             // Push each faces.
             for (let i = 0; i < 6; i++) {
-                const dataFace = (data as any)[ImageCubeTexture._FacesMapping[i]];
+                const dataFace = (data as any)[EquirectangularCubeTexture._FacesMapping[i]];
                 results.push(dataFace);
             }
 
@@ -172,23 +172,23 @@ export class ImageCubeTexture extends BaseTexture {
 
     /**
      * Get the current class name of the texture useful for serialization or dynamic coding.
-     * @returns "ImageCubeTexture"
+     * @returns "EquirectangularCubeTexture"
      */
     public getClassName(): string {
-        return "ImageCubeTexture";
+        return "EquirectangularCubeTexture";
     }
 
     /**
-     * Create a clone of the current ImageCubeTexture and return it.
-     * @returns A clone of the current ImageCubeTexture.
+     * Create a clone of the current EquirectangularCubeTexture and return it.
+     * @returns A clone of the current EquirectangularCubeTexture.
      */
-    public clone(): ImageCubeTexture {
+    public clone(): EquirectangularCubeTexture {
         const scene = this.getScene();
         if (!scene) {
             return this;
         }
 
-        const newTexture = new ImageCubeTexture(this.url, scene, this._size, this._noMipmap, this.gammaSpace);
+        const newTexture = new EquirectangularCubeTexture(this.url, scene, this._size, this._noMipmap, this.gammaSpace);
 
         // Base texture
         newTexture.level = this.level;

+ 1 - 1
src/Materials/Textures/index.ts

@@ -2,8 +2,8 @@ export * from "./baseTexture";
 export * from "./colorGradingTexture";
 export * from "./cubeTexture";
 export * from "./dynamicTexture";
+export * from "./equirectangularCubeTexture";
 export * from "./hdrCubeTexture";
-export * from "./imageCubeTexture";
 export * from "./internalTexture";
 export * from "./internalTextureLoader";
 export * from "./internalTextureTracker";