예제 #1
0
        public static CompoundMeshDraft GroundFloorThing(Vector3 min, Vector3 width, Vector3 height)
        {
            var compoundDraft = new CompoundMeshDraft();

            compoundDraft.Add(new MeshDraft {
                name = WallDraftName
            }                                                         //Wall below
                              .AddQuad(min, width, 0.5f * Vector3.up, true)).Paint(Color.black);

            CurrentBuilding.SetRandomGroundFloorType();    //So that every ground floor thing is different
            compoundDraft.Add(new MeshDraft {
                name = CurrentBuilding.GroundFloorType
            }                                                                           //The showcase or thing itself
                              .AddGroundFloorThingQuad(min + 0.5f * Vector3.up, width, height - 0.5f * Vector3.up)).Paint(Color.blue);
            // compoundDraft.Add(new MeshDraft {name = "TransparentGlass"}    //The glass in front of the thing
            //     .AddQuad(min + 0.5f * Vector3.up + 0.001f * Vector3.back, width, height - 0.5f * Vector3.up, true)).Paint(Color.blue);
            return(compoundDraft);
        }
예제 #2
0
        private ILayout PlanNormalFacade(float facadeWidth, int floors, bool hasAttic, bool leftIsConvex, bool rightIsConvex)
        {
            CurrentBuilding.SetRandomFacadeType();

            List <PanelSize> panelSizes = DivideFacade(facadeWidth, leftIsConvex, rightIsConvex, out float remainder);
            //bool hasBalconies = RandomE.Chance(0.5f);
            bool hasBalconies = false;

            var vertical = CreateNormalFacadeVertical(panelSizes, 0, panelSizes.Count, floors, hasAttic, hasBalconies, facadeWidth, remainder);

            if (remainder > Geometry.Epsilon)
            {
                return(new HorizontalLayout
                {
                    CreateBufferWallVertical(remainder / 2, floors, hasAttic),
                    vertical,
                    CreateBufferWallVertical(remainder / 2, floors, hasAttic)
                });
            }
            return(vertical);
        }