void Start()
        {
            Instance = this;

            transformSet   = new TransformSet();
            HeatCalculator = new HeatCalculator()
            {
                Type = HeatTypes.None
            };

            int res = 513;

            RockMap     = new float[res, res];
            SoilMap     = new float[res, res];
            WaterMap    = new float[res, res];
            SurfaceMap  = new int[res, res];
            HumidityMap = new float[res, res];

            LoadMaps();

            SimulationInterval = 5000;
            EditConfigs        = new EditConfigs();

            UpdateTransformMaps();
            UpdateHeatCalculatorMaps();
            UpdateView(true);
        }
Exemplo n.º 2
0
 public static ICamera CreateCamera(string name, ParameterSet paramSet, TransformSet camToWorldSet, double transformStart, double transformEnd, IFilm film)
 {
     Transform[] camToWorld = new Transform[2];
     Transform temp;
     Api.TransformCache.Lookup (camToWorldSet[0], out camToWorld[0], out temp);
     Api.TransformCache.Lookup (camToWorldSet[1], out camToWorld[1], out temp);
     AnimatedTransform animatedCamToWorld = new AnimatedTransform (camToWorld[0], transformStart, camToWorld[1], transformEnd);
     CameraPlugin plugin = new CameraPlugin (name);
     return plugin.CreateCamera (paramSet, animatedCamToWorld, film);
 }
Exemplo n.º 3
0
        public override void Process(SceneReaderContext context)
        {
            switch (DirectiveType)
            {
            case StandardDirectiveType.Accelerator:
                context.VerifyOptions("Accelerator");
                context.RenderOptions.AcceleratorName   = ImplementationType;
                context.RenderOptions.AcceleratorParams = Parameters;
                break;

            case StandardDirectiveType.AreaLightSource:
                context.VerifyWorld("AreaLightSource");
                context.GraphicsState.AreaLight       = ImplementationType;
                context.GraphicsState.AreaLightParams = Parameters;
                break;

            case StandardDirectiveType.Camera:
                context.VerifyOptions("Camera");
                context.RenderOptions.CameraName         = ImplementationType;
                context.RenderOptions.CameraParams       = Parameters;
                context.RenderOptions.CameraToWorld      = TransformSet.Invert(context.CurrentTransform);
                context.NamedCoordinateSystems["camera"] = context.RenderOptions.CameraToWorld;
                break;

            case StandardDirectiveType.Film:
                context.VerifyOptions("Film");
                context.RenderOptions.FilmName   = ImplementationType;
                context.RenderOptions.FilmParams = Parameters;
                break;

            case StandardDirectiveType.LightSource:
                context.VerifyWorld("LightSource");
                context.RenderOptions.Lights.Add(Factories.MakeLight(
                                                     ImplementationType, context.CurrentTransform[0], Parameters));
                break;

            case StandardDirectiveType.Material:
                context.VerifyWorld("Material");
                context.GraphicsState.Material             = ImplementationType;
                context.GraphicsState.MaterialParams       = Parameters;
                context.GraphicsState.CurrentNamedMaterial = "";
                break;

            case StandardDirectiveType.PixelFilter:
                context.VerifyOptions("PixelFilter");
                context.RenderOptions.FilterName   = ImplementationType;
                context.RenderOptions.FilterParams = Parameters;
                break;

            case StandardDirectiveType.Renderer:
                context.VerifyOptions("Renderer");
                context.RenderOptions.RendererName   = ImplementationType;
                context.RenderOptions.RendererParams = Parameters;
                break;

            case StandardDirectiveType.Sampler:
                context.VerifyOptions("Sampler");
                context.RenderOptions.SamplerName   = ImplementationType;
                context.RenderOptions.SamplerParams = Parameters;
                break;

            case StandardDirectiveType.Shape:
                context.VerifyWorld("Shape");
                ProcessShape(context);
                break;

            case StandardDirectiveType.SurfaceIntegrator:
                context.VerifyOptions("SurfaceIntegrator");
                context.RenderOptions.SurfaceIntegratorName   = ImplementationType;
                context.RenderOptions.SurfaceIntegratorParams = Parameters;
                break;

            case StandardDirectiveType.Volume:
                context.VerifyWorld("Volume");
                context.RenderOptions.VolumeRegions.Add(Factories.MakeVolumeRegion(
                                                            ImplementationType, context.CurrentTransform[0], Parameters));
                break;

            case StandardDirectiveType.VolumeIntegrator:
                context.VerifyOptions("VolumeIntegrator");
                context.RenderOptions.VolumeIntegratorName   = ImplementationType;
                context.RenderOptions.VolumeIntegratorParams = Parameters;
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }
        }