protected StoryFlowchartEdgeGizmoComponent(IEmbeddedResources embeddedResources) { var lineModel = embeddedResources.LineModel(); Material = StandardMaterial.New() .SetDiffuseColor(new Color4(0f, 0.5f, 0f)) .SetIgnoreLighting(true) .FromGlobalCache(); RenderState = StandardRenderState.New() .SetLineWidth(3) .FromGlobalCache(); visualElements = new IVisualElement[] { new ModelVisualElement <StoryFlowchartEdgeGizmoComponent>(this) .SetModel(lineModel) .SetMaterial(x => x.Material) .SetTransform(x => GetTransformForLine(x.FirstPoint, x.MiddlePoint)), new ModelVisualElement <StoryFlowchartEdgeGizmoComponent>(this) .SetModel(lineModel) .SetMaterial(x => x.Material) .SetTransform(x => GetTransformForLine(x.MiddlePoint, x.LastPoint)) }; }
public DragAlongAxisGizmoComponent(IEmbeddedResources embeddedResources) { model = embeddedResources.LineModel(); visualElement = new ModelVisualElement <DragAlongAxisGizmoComponent>(this) .SetModel(model) .SetMaterial(x => x.material) .SetTransform(x => x.transform); hittable = new LineHittable <DragAlongAxisGizmoComponent>(this, x => x.GetGlobalLine(), PixelLineWidth); }
public NestedCirclesStoryLayout(IEmbeddedResources embeddedResources, ICoroutineService coroutineService) { this.coroutineService = coroutineService; planeModel = embeddedResources.SimplePlaneXyModel(); circleModel = embeddedResources.CircleModel(64); lineModel = embeddedResources.LineModel(); circleMaterials = new IMaterial[] { StandardMaterial.New().SetDiffuseColor(new Color4(new Color3(1f, 0f, 0f) * 0.5f, 1.0f)).SetIgnoreLighting(true).FromGlobalCache(), StandardMaterial.New().SetDiffuseColor(new Color4(new Color3(0f, 1f, 0f) * 0.5f, 1.0f)).SetIgnoreLighting(true).FromGlobalCache(), StandardMaterial.New().SetDiffuseColor(new Color4(new Color3(0f, 0f, 1f) * 0.5f, 1.0f)).SetIgnoreLighting(true).FromGlobalCache(), StandardMaterial.New().SetDiffuseColor(new Color4(new Color3(1f, 1f, 0f) * 0.5f, 1.0f)).SetIgnoreLighting(true).FromGlobalCache(), StandardMaterial.New().SetDiffuseColor(new Color4(new Color3(1f, 0f, 1f) * 0.5f, 1.0f)).SetIgnoreLighting(true).FromGlobalCache(), StandardMaterial.New().SetDiffuseColor(new Color4(new Color3(0f, 1f, 1f) * 0.5f, 1.0f)).SetIgnoreLighting(true).FromGlobalCache() }; lineMaterial = StandardMaterial.New().SetDiffuseColor(Color4.Blue).FromGlobalCache(); lineMaterialExternal = StandardMaterial.New().SetDiffuseColor(0.7f * Color4.White).FromGlobalCache(); circleRenderState = StandardRenderState.New() .SetLineWidth(2) .SetCullFace(CullFace.Front) .FromGlobalCache(); lineRenderState = StandardRenderState.New().SetLineWidth(3).FromGlobalCache(); }
public NestedSpheresStoryLayout(IEmbeddedResources embeddedResources, ICoroutineService coroutineService, Lazy <IViewService> viewServiceLazy) { this.coroutineService = coroutineService; this.viewServiceLazy = viewServiceLazy; focusVisualEffect = new FocusVisualEffect(); mainModel = embeddedResources.SphereModel(64, true); lineModel = embeddedResources.LineModel(); sphereMaterials = new IMaterial[] { StandardMaterial.New().SetDiffuseColor(new Color4(new Color3(1.0f, 0.5f, 0.5f) * 1.0f, 0.5f)).FromGlobalCache(), StandardMaterial.New().SetDiffuseColor(new Color4(new Color3(0.5f, 1.0f, 0.5f) * 1.0f, 0.5f)).FromGlobalCache(), StandardMaterial.New().SetDiffuseColor(new Color4(new Color3(0.5f, 0.5f, 1.0f) * 1.0f, 0.5f)).FromGlobalCache(), StandardMaterial.New().SetDiffuseColor(new Color4(new Color3(1.0f, 1.0f, 0.5f) * 1.0f, 0.5f)).FromGlobalCache(), StandardMaterial.New().SetDiffuseColor(new Color4(new Color3(1.0f, 0.5f, 1.0f) * 1.0f, 0.5f)).FromGlobalCache(), StandardMaterial.New().SetDiffuseColor(new Color4(new Color3(0.5f, 1.0f, 1.0f) * 1.0f, 0.5f)).FromGlobalCache(), }; sphereRenderState = StandardRenderState.New().SetCullFace(CullFace.Back).FromGlobalCache(); lineMaterial = StandardMaterial.New().SetDiffuseColor(Color4.Red).FromGlobalCache(); lineMaterialExternal = StandardMaterial.New().SetDiffuseColor(0.7f * Color4.Red); lineRenderState = StandardRenderState.New().SetLineWidth(3).FromGlobalCache(); }
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(); }