Esempio n. 1
0
        internal static void CreateCloudLayer(
            uint ID,
            Vector3D centerPoint,
            double altitude,
            double minScaledAltitude,
            bool scalingEnabled,
            double fadeOutRelativeAltitudeStart,
            double fadeOutRelativeAltitudeEnd,
            float applyFogRelativeDistance,
            double maxPlanetHillRadius,
            string model,
            List <string> textures,
            Vector3D rotationAxis,
            float angularVelocity,
            float radiansAroundAxis)
        {
            MeshId mesh = MyMeshes.GetMeshId(X.TEXT(model));

            MyCloudLayer.MyCloudTextureInfo textureInfo;
            if (textures != null && textures.Count > 0) // TODO: Multiple textures
            {
                var cmTexture          = textures[0].Insert(textures[0].LastIndexOf('.'), "_cm");
                var alphaTexture       = textures[0].Insert(textures[0].LastIndexOf('.'), "_alphamask");
                var normalGlossTexture = textures[0].Insert(textures[0].LastIndexOf('.'), "_ng");
                textureInfo = new MyCloudLayer.MyCloudTextureInfo
                {
                    ColorMetalTexture  = MyTextures.GetTexture(cmTexture, MyTextureEnum.COLOR_METAL),
                    AlphaTexture       = MyTextures.GetTexture(alphaTexture, MyTextureEnum.ALPHAMASK),
                    NormalGlossTexture = MyTextures.GetTexture(normalGlossTexture, MyTextureEnum.NORMALMAP_GLOSS),
                };
            }
            else
            {
                textureInfo = new MyCloudLayer.MyCloudTextureInfo
                {
                    ColorMetalTexture  = MyTextures.GetTexture(MyMeshes.GetMeshPart(mesh, 0, 0).Info.Material.Info.ColorMetal_Texture.ToString(), MyTextureEnum.COLOR_METAL),
                    AlphaTexture       = MyTextures.GetTexture(MyMeshes.GetMeshPart(mesh, 0, 0).Info.Material.Info.Alphamask_Texture.ToString(), MyTextureEnum.ALPHAMASK),
                    NormalGlossTexture = MyTextures.GetTexture(MyMeshes.GetMeshPart(mesh, 0, 0).Info.Material.Info.NormalGloss_Texture.ToString(), MyTextureEnum.NORMALMAP_GLOSS),
                }
            };

            m_cloudLayers.Add(ID, new MyCloudLayer
            {
                CenterPoint                  = centerPoint,
                Altitude                     = altitude,
                MinScaledAltitude            = minScaledAltitude,
                ScalingEnabled               = scalingEnabled,
                FadeOutRelativeAltitudeStart = fadeOutRelativeAltitudeStart,
                FadeOutRelativeAltitudeEnd   = fadeOutRelativeAltitudeEnd,
                ApplyFogRelativeDistance     = applyFogRelativeDistance,
                MaxPlanetHillRadius          = maxPlanetHillRadius,
                Mesh            = mesh,
                TextureInfo     = textureInfo,
                RotationAxis    = rotationAxis,
                AngularVelocity = angularVelocity,
            });
            m_modifiableCloudLayerData.Add(ID, new MyModifiableCloudLayerData {
                RadiansAroundAxis = radiansAroundAxis, LastGameplayFrameUpdate = MyRender11.Settings.GameplayFrame
            });
        }
        internal static void CreateCloudLayer(
            uint ID,
            Vector3D centerPoint,
            double altitude,
            double minScaledAltitude,
            bool scalingEnabled,
            double fadeOutRelativeAltitudeStart,
            double fadeOutRelativeAltitudeEnd,
            float applyFogRelativeDistance,
            double maxPlanetHillRadius,
            string model,
            List<string> textures,
            Vector3D rotationAxis,
            float angularVelocity,
            float radiansAroundAxis)
        {
            MeshId mesh = MyMeshes.GetMeshId(X.TEXT_(model), 1.0f);
            MyCloudLayer.MyCloudTextureInfo textureInfo;
            if (textures != null && textures.Count > 0) // TODO: Multiple textures
            {
                var cmTexture = textures[0].Insert(textures[0].LastIndexOf('.'), "_cm");
                var alphaTexture = textures[0].Insert(textures[0].LastIndexOf('.'), "_alphamask");
                var normalGlossTexture = textures[0].Insert(textures[0].LastIndexOf('.'), "_ng");
                textureInfo = new MyCloudLayer.MyCloudTextureInfo
                {
                    ColorMetalTexture = MyTextures.GetTexture(cmTexture, MyTextureEnum.COLOR_METAL),
                    AlphaTexture = MyTextures.GetTexture(alphaTexture, MyTextureEnum.ALPHAMASK),
                    NormalGlossTexture = MyTextures.GetTexture(normalGlossTexture, MyTextureEnum.NORMALMAP_GLOSS),
                };
            }
            else
                textureInfo = new MyCloudLayer.MyCloudTextureInfo
                {
                    ColorMetalTexture = MyTextures.GetTexture(MyMeshes.GetMeshPart(mesh, 0, 0).Info.Material.Info.ColorMetal_Texture.ToString(), MyTextureEnum.COLOR_METAL),
                    AlphaTexture = MyTextures.GetTexture(MyMeshes.GetMeshPart(mesh, 0, 0).Info.Material.Info.Alphamask_Texture.ToString(), MyTextureEnum.ALPHAMASK),
                    NormalGlossTexture = MyTextures.GetTexture(MyMeshes.GetMeshPart(mesh, 0, 0).Info.Material.Info.NormalGloss_Texture.ToString(), MyTextureEnum.NORMALMAP_GLOSS),
                };

            m_cloudLayers.Add(ID, new MyCloudLayer
            {
                CenterPoint = centerPoint,
                Altitude = altitude,
                MinScaledAltitude = minScaledAltitude,
                ScalingEnabled = scalingEnabled,
                FadeOutRelativeAltitudeStart = fadeOutRelativeAltitudeStart,
                FadeOutRelativeAltitudeEnd = fadeOutRelativeAltitudeEnd,
                ApplyFogRelativeDistance = applyFogRelativeDistance,
                MaxPlanetHillRadius = maxPlanetHillRadius,
                Mesh = mesh,
                TextureInfo = textureInfo,
                RotationAxis = rotationAxis,
                AngularVelocity = angularVelocity,
            });
            m_modifiableCloudLayerData.Add(ID, new MyModifiableCloudLayerData { RadiansAroundAxis = radiansAroundAxis, LastGameplayFrameUpdate = MyRender11.Settings.GameplayFrame });
        }