Ejemplo n.º 1
0
        public object ExportGLTFExtension <T1, T2>(T1 babylonObject, ref T2 gltfObject, ref GLTF gltf, GLTFExporter exporter, ExtensionInfo extInfo)
        {
            var babylonScene = babylonObject as BabylonScene;

            if (babylonScene != null)
            {
                GLTFExtensionGlobalFadeScale fadeScale = new GLTFExtensionGlobalFadeScale();
                float fadeGlobalScale = Loader.Core.RootNode.GetFloatProperty("flightsim_fade_globalscale", 1);
                fadeScale.scale = fadeGlobalScale;

                if (fadeScale.scale != 1.0f)
                {
                    return(fadeScale);
                }
            }
            return(null);
        }
        public object ExportGLTFExtension <T>(T babylonObject, ExportParameters parameters, ref GLTF gltf, ILoggingProvider logger)
        {
            var babylonScene = babylonObject as BabylonScene;

            if (babylonScene != null)
            {
                GLTFExtensionGlobalFadeScale fadeScale = new GLTFExtensionGlobalFadeScale();
                float fadeGlobalScale = Loader.Core.RootNode.GetFloatProperty("flightsim_fade_globalscale", 1);
                fadeScale.scale = fadeGlobalScale;

                if (fadeScale.scale != 1.0f)
                {
                    return(fadeScale);
                }
            }
            return(null);
        }