|
@@ -144,73 +144,5 @@
|
|
|
this.onDispose();
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- public static ParseCubeTexture(parsedTexture: any, scene: Scene, rootUrl: string): CubeTexture {
|
|
|
- var texture = null;
|
|
|
- if ((parsedTexture.name || parsedTexture.extensions) && !parsedTexture.isRenderTarget) {
|
|
|
- texture = new BABYLON.CubeTexture(rootUrl + parsedTexture.name, scene, parsedTexture.extensions);
|
|
|
- texture.name = parsedTexture.name;
|
|
|
- texture.hasAlpha = parsedTexture.hasAlpha;
|
|
|
- texture.level = parsedTexture.level;
|
|
|
- texture.coordinatesMode = parsedTexture.coordinatesMode;
|
|
|
- }
|
|
|
- return texture;
|
|
|
- }
|
|
|
-
|
|
|
- public static ParseTexture(parsedTexture: any, scene: Scene, rootUrl: string): BaseTexture {
|
|
|
- if (parsedTexture.isCube) {
|
|
|
- return BaseTexture.ParseCubeTexture(parsedTexture, scene, rootUrl);
|
|
|
- }
|
|
|
-
|
|
|
- if (!parsedTexture.name && !parsedTexture.isRenderTarget) {
|
|
|
- return null;
|
|
|
- }
|
|
|
-
|
|
|
- var texture;
|
|
|
-
|
|
|
- if (parsedTexture.mirrorPlane) {
|
|
|
- texture = new MirrorTexture(parsedTexture.name, parsedTexture.renderTargetSize, scene);
|
|
|
- texture._waitingRenderList = parsedTexture.renderList;
|
|
|
- texture.mirrorPlane = Plane.FromArray(parsedTexture.mirrorPlane);
|
|
|
- } else if (parsedTexture.isRenderTarget) {
|
|
|
- texture = new RenderTargetTexture(parsedTexture.name, parsedTexture.renderTargetSize, scene);
|
|
|
- texture._waitingRenderList = parsedTexture.renderList;
|
|
|
- } else {
|
|
|
- if (parsedTexture.base64String) {
|
|
|
- texture = Texture.CreateFromBase64String(parsedTexture.base64String, parsedTexture.name, scene);
|
|
|
- } else {
|
|
|
- texture = new Texture(rootUrl + parsedTexture.name, scene);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- texture.name = parsedTexture.name;
|
|
|
- texture.hasAlpha = parsedTexture.hasAlpha;
|
|
|
- texture.getAlphaFromRGB = parsedTexture.getAlphaFromRGB;
|
|
|
- texture.level = parsedTexture.level;
|
|
|
-
|
|
|
- texture.coordinatesIndex = parsedTexture.coordinatesIndex;
|
|
|
- texture.coordinatesMode = parsedTexture.coordinatesMode;
|
|
|
- texture.uOffset = parsedTexture.uOffset;
|
|
|
- texture.vOffset = parsedTexture.vOffset;
|
|
|
- texture.uScale = parsedTexture.uScale;
|
|
|
- texture.vScale = parsedTexture.vScale;
|
|
|
- texture.uAng = parsedTexture.uAng;
|
|
|
- texture.vAng = parsedTexture.vAng;
|
|
|
- texture.wAng = parsedTexture.wAng;
|
|
|
-
|
|
|
- texture.wrapU = parsedTexture.wrapU;
|
|
|
- texture.wrapV = parsedTexture.wrapV;
|
|
|
-
|
|
|
- // Animations
|
|
|
- if (parsedTexture.animations) {
|
|
|
- for (var animationIndex = 0; animationIndex < parsedTexture.animations.length; animationIndex++) {
|
|
|
- var parsedAnimation = parsedTexture.animations[animationIndex];
|
|
|
-
|
|
|
- texture.animations.push(Animation.ParseAnimation(parsedAnimation));
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- return texture;
|
|
|
- }
|
|
|
}
|
|
|
}
|