예제 #1
0
 public MuseumStoryLayout(IEmbeddedResources embeddedResources, IWorldTreeService worldTreeService)
 {
     this.worldTreeService = worldTreeService;
     floorModel            = embeddedResources.PlaneModel(PlaneModelSourcePlane.Xy, PlaneModelSourceNormalDirection.Positive,
                                                          globalRadius, globalRadius, 1, 1);
     ceilingModel = embeddedResources.PlaneModel(PlaneModelSourcePlane.Xy, PlaneModelSourceNormalDirection.Negative,
                                                 globalRadius, globalRadius, 1, 1);
     exitWallModel = embeddedResources.PlaneModel(PlaneModelSourcePlane.Xz, PlaneModelSourceNormalDirection.Negative,
                                                  exitHalfLength, ceilingHalfHeight, 1, 1);
     corridorWallModel = embeddedResources.PlaneModel(PlaneModelSourcePlane.Xz, PlaneModelSourceNormalDirection.Negative,
                                                      corridorHalfWidth, ceilingHalfHeight, 1, 1);
     frustumModel  = embeddedResources.SimpleFrustumModel();
     floorMaterial = StandardMaterial.New()
                     .SetDiffuseMap(embeddedResources.Image("Textures/museum_floor.jpg"))
                     .SetNoSpecular(true)
                     .FromGlobalCache();
     ceilingMaterial = StandardMaterial.New()
                       .SetDiffuseMap(embeddedResources.Image("Textures/museum_ceiling.jpg"))
                       .SetNoSpecular(true)
                       .FromGlobalCache();
     wallMaterial = StandardMaterial.New()
                    .SetDiffuseMap(embeddedResources.Image("Textures/museum_wall.jpg"))
                    .SetNoSpecular(true)
                    .FromGlobalCache();
     frustumMaterial = StandardMaterial.New()
                       .SetDiffuseColor(Color4.Green)
                       .SetIgnoreLighting(true)
                       .FromGlobalCache();
 }
예제 #2
0
 public SphereStoryLayout(IEmbeddedResources embeddedResources)
 {
     frustumModel    = embeddedResources.SimpleFrustumModel();
     frustumMaterial = StandardMaterial.New()
                       .SetDiffuseColor(Color4.Green)
                       .SetIgnoreLighting(true)
                       .FromGlobalCache();
 }
예제 #3
0
 public OrbitStoryLayout(IEmbeddedResources embeddedResources)
 {
     frustumModel    = embeddedResources.SimpleFrustumModel();
     circleModel     = embeddedResources.CircleModel(256);
     frustumMaterial = StandardMaterial.New()
                       .SetDiffuseColor(Color4.Green)
                       .SetIgnoreLighting(true)
                       .FromGlobalCache();
     circleMaterial = StandardMaterial.New()
                      .SetDiffuseColor(Color4.Yellow)
                      .SetIgnoreLighting(true)
                      .FromGlobalCache();
 }
예제 #4
0
        public BuildingStoryLayout(ICoroutineService coroutineService, IEmbeddedResources embeddedResources,
                                   IInputService inputService, Lazy <INavigationService> navigationServiceLazy)
        {
            this.embeddedResources     = embeddedResources;
            this.inputService          = inputService;
            this.navigationServiceLazy = navigationServiceLazy;
            this.coroutineService      = coroutineService;
            planeModel     = embeddedResources.SimplePlaneXzModel();
            lineModel      = embeddedResources.LineModel();
            frustumModel   = embeddedResources.SimpleFrustumModel();
            colorMaterials = new IMaterial[]
            {
                StandardMaterial.New().SetDiffuseColor(new Color4(new Color3(1f, 0f, 0f) * 0.8f, 1.0f)).SetIgnoreLighting(true),
                StandardMaterial.New().SetDiffuseColor(new Color4(new Color3(0f, 1f, 0f) * 0.8f, 1.0f)).SetIgnoreLighting(true),
                StandardMaterial.New().SetDiffuseColor(new Color4(new Color3(0f, 0f, 1f) * 0.8f, 1.0f)).SetIgnoreLighting(true),
                StandardMaterial.New().SetDiffuseColor(new Color4(new Color3(1f, 1f, 0f) * 0.8f, 1.0f)).SetIgnoreLighting(true),
                StandardMaterial.New().SetDiffuseColor(new Color4(new Color3(1f, 0f, 1f) * 0.8f, 1.0f)).SetIgnoreLighting(true),
                StandardMaterial.New().SetDiffuseColor(new Color4(new Color3(0f, 1f, 1f) * 0.8f, 1.0f)).SetIgnoreLighting(true),
            };
            frustumMaterial = StandardMaterial.New()
                              .SetDiffuseColor(new Color4(0f, 1f, 0f))
                              .SetIgnoreLighting(true)
                              .FromGlobalCache();
            lineMaterial = StandardMaterial.New()
                           .SetDiffuseColor(Color4.White)
                           .SetIgnoreLighting(true)
                           .FromGlobalCache();
            currentLineMaterial = StandardMaterial.New()
                                  .SetDiffuseColor(Color4.Red)
                                  .SetIgnoreLighting(true)
                                  .FromGlobalCache();
            lineRenderState = StandardRenderState.New().SetLineWidth(3).FromGlobalCache();

            var mirrorSampler = new ImageSampler
            {
                AddressModeU = ImageSamplerAddressMode.Mirror,
                AddressModeV = ImageSamplerAddressMode.Mirror,
                AddressModeW = ImageSamplerAddressMode.Mirror,
            }.FromGlobalCache();

            floorMaterial = StandardMaterial.New()
                            .SetDiffuseMap(embeddedResources.Image("Textures/museum_floor.jpg"))
                            .SetNoSpecular(true)
                            .SetSampler(mirrorSampler)
                            .FromGlobalCache();
            ceilingMaterial = StandardMaterial.New()
                              .SetDiffuseMap(embeddedResources.Image("Textures/museum_ceiling.jpg"))
                              .SetNoSpecular(true)
                              .SetSampler(mirrorSampler)
                              .FromGlobalCache();
            wallMaterial = StandardMaterial.New()
                           .SetDiffuseMap(embeddedResources.Image("Textures/museum_wall.jpg"))
                           .SetDiffuseColor(new Color4(92, 82, 72))
                           //.SetNoSpecular(true)
                           .SetNormalMap(embeddedResources.Image("Textures/museum_wall_2_norm.jpg"))
                           .FromGlobalCache();
            rawWallMaterial = StandardMaterial.New()
                              .SetDiffuseColor(Color4.Green)
                              .SetIgnoreLighting(true)
                              .FromGlobalCache();
        }