예제 #1
0
 // Ensure that the brush coordinates are
 // turned the right way.
 public static void fixDirection(ref IntVec3 veca, ref IntVec3 vecb)
 {
     var a = new IntVec3(
             Math.Min(veca.x, vecb.x),
             Math.Min(veca.y, vecb.y),
             Math.Min(veca.z, vecb.z));
     var b = new IntVec3(
             Math.Max(veca.x, vecb.x),
             Math.Max(veca.y, vecb.y),
             Math.Max(veca.z, vecb.z));
     veca = a;
     vecb = b;
 }
예제 #2
0
 public IntPlane(IntVec3 veca, IntVec3 vecb, IntVec3 vecc)
 {
     this.VectorA = veca;
     this.VectorB = vecb;
     this.VectorC = vecc;
 }
예제 #3
0
 public JAInfoPlayerDeathmatchEntity(IntVec3 origin)
     : base(origin)
 {
     attributes.Add("classname", "info_player_deathmatch");
 }
예제 #4
0
 public LightEntity(IntVec3 origin, int intensity, Q3Color color)
     : base(origin)
 {
     attributes.Add("classname", "light");
     attributes.Add("light", intensity.ToString());
     attributes.Add("_color", color.ToString());
 }
예제 #5
0
 public BrushFace(IntVec3 a, IntVec3 b, IntVec3 c)
     : this(new IntPlane(a, b, c), BrushFace.DEFAULT_TEXTURE)
 {
 }
예제 #6
0
 public Entity(IntVec3 origin)
 {
     attributes.Add("origin", origin.ToString());
 }
예제 #7
0
        public HollowBoxGenerator(IntVec3 origin, IntVec3 dimensions, int wallThickness, Texture texture)
        {
            // Top
            {
                var veca = new IntVec3(
                    origin.x - (dimensions.x / 2),
                    origin.y - (dimensions.y / 2),
                    origin.z + (dimensions.z / 2) - wallThickness);
                var vecb = new IntVec3(
                    origin.x + (dimensions.x / 2),
                    origin.y + (dimensions.y / 2),
                    origin.z + (dimensions.z / 2));
                brushes.AddRange(new RightHexahedralBrushGenerator(veca, vecb, texture).Brushes);
            }

            // Bottom
            {
                var veca = new IntVec3(
                    origin.x - (dimensions.x / 2),
                    origin.y - (dimensions.y / 2),
                    origin.z - (dimensions.z / 2));
                var vecb = new IntVec3(
                    origin.x + (dimensions.x / 2),
                    origin.y + (dimensions.y / 2),
                    origin.z - (dimensions.z / 2) + wallThickness);
                brushes.AddRange(new RightHexahedralBrushGenerator(veca, vecb, texture).Brushes);
            }

            // Side +x
            {
                var veca = new IntVec3(
                    origin.x + (dimensions.x / 2) - wallThickness,
                    origin.y - (dimensions.y / 2),
                    origin.z - (dimensions.z / 2));
                var vecb = new IntVec3(
                    origin.x + (dimensions.x / 2),
                    origin.y + (dimensions.y / 2),
                    origin.z + (dimensions.z / 2));
                brushes.AddRange(new RightHexahedralBrushGenerator(veca, vecb, texture).Brushes);
            }

            // Side -x
            {
                var veca = new IntVec3(
                    origin.x - (dimensions.x / 2),
                    origin.y - (dimensions.y / 2),
                    origin.z - (dimensions.z / 2));
                var vecb = new IntVec3(
                    origin.x - (dimensions.x / 2) + wallThickness,
                    origin.y + (dimensions.y / 2),
                    origin.z + (dimensions.z / 2));
                brushes.AddRange(new RightHexahedralBrushGenerator(veca, vecb, texture).Brushes);
            }

            // Side +y
            {
                var veca = new IntVec3(
                    origin.x - (dimensions.x / 2),
                    origin.y + (dimensions.y / 2) - wallThickness,
                    origin.z - (dimensions.z / 2));
                var vecb = new IntVec3(
                    origin.x + (dimensions.x / 2),
                    origin.y + (dimensions.y / 2),
                    origin.z + (dimensions.z / 2));
                brushes.AddRange(new RightHexahedralBrushGenerator(veca, vecb, texture).Brushes);
            }

            // Side -y
            {
                var veca = new IntVec3(
                    origin.x - (dimensions.x / 2),
                    origin.y - (dimensions.y / 2),
                    origin.z - (dimensions.z / 2));
                var vecb = new IntVec3(
                    origin.x + (dimensions.x / 2),
                    origin.y - (dimensions.y / 2) + wallThickness,
                    origin.z + (dimensions.z / 2));
                brushes.AddRange(new RightHexahedralBrushGenerator(veca, vecb, texture).Brushes);
            }
        }
예제 #8
0
 public BrushFace(IntVec3 a, IntVec3 b, IntVec3 c, Texture texture)
     : this(new IntPlane(a, b, c), texture)
 {
 }
예제 #9
0
 public HollowBoxGenerator(IntVec3 origin, IntVec3 dimensions, int wallThickness)
     : this(origin, dimensions, wallThickness, BrushFace.DEFAULT_TEXTURE)
 {
 }
예제 #10
0
 public DiamondSquareTriSoupGenerator(IntVec3 veca, IntVec3 vecb, int scale, float randomnessFactor)
 {
     var xCount = (vecb.x - veca.x) / scale;
     var yCount = (vecb.y - veca.y) / scale;
 }
예제 #11
0
        public TriSoupBrushGenerator(IntVec3 veca, IntVec3 vecb, Texture texture)
        {
            this.spoint = veca;
            this.epoint = vecb;
            Utils.fixDirection(ref this.spoint, ref this.epoint);

            Brush b = new Brush();

            b.AddFace(new BrushFace(new IntPlane(this.spoint.x, 0, 0, this.spoint.x, 1, 0, this.spoint.x, 0, 1), texture));
            b.AddFace(new BrushFace(new IntPlane(this.epoint.x, 0, 0, this.epoint.x, 0, 1, this.epoint.x, 1, 0), texture));
            b.AddFace(new BrushFace(new IntPlane(0, this.spoint.y, 0, 0, this.spoint.y, 1, 1, this.spoint.y, 0), texture));
            b.AddFace(new BrushFace(new IntPlane(0, this.epoint.y, 0, 1, this.epoint.y, 0, 0, this.epoint.y, 1), texture));
            b.AddFace(new BrushFace(new IntPlane(0, 0, this.spoint.z, 1, 0, this.spoint.z, 0, 1, this.spoint.z), texture));
            b.AddFace(new BrushFace(new IntPlane(0, 0, this.epoint.z, 0, 1, this.epoint.z, 1, 0, this.epoint.z), texture));

            brushes.Add(b);
        }
예제 #12
0
 public TriSoupBrushGenerator(IntVec3 veca, IntVec3 vecb)
     : this(veca, vecb, BrushFace.DEFAULT_TEXTURE)
 {
 }
예제 #13
0
 public RightHexahedralBrushGenerator(IntVec3 veca, IntVec3 vecb)
     : this(veca, vecb, BrushFace.DEFAULT_TEXTURE)
 {
 }