// 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; }
public IntPlane(IntVec3 veca, IntVec3 vecb, IntVec3 vecc) { this.VectorA = veca; this.VectorB = vecb; this.VectorC = vecc; }
public JAInfoPlayerDeathmatchEntity(IntVec3 origin) : base(origin) { attributes.Add("classname", "info_player_deathmatch"); }
public LightEntity(IntVec3 origin, int intensity, Q3Color color) : base(origin) { attributes.Add("classname", "light"); attributes.Add("light", intensity.ToString()); attributes.Add("_color", color.ToString()); }
public BrushFace(IntVec3 a, IntVec3 b, IntVec3 c) : this(new IntPlane(a, b, c), BrushFace.DEFAULT_TEXTURE) { }
public Entity(IntVec3 origin) { attributes.Add("origin", origin.ToString()); }
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); } }
public BrushFace(IntVec3 a, IntVec3 b, IntVec3 c, Texture texture) : this(new IntPlane(a, b, c), texture) { }
public HollowBoxGenerator(IntVec3 origin, IntVec3 dimensions, int wallThickness) : this(origin, dimensions, wallThickness, BrushFace.DEFAULT_TEXTURE) { }
public DiamondSquareTriSoupGenerator(IntVec3 veca, IntVec3 vecb, int scale, float randomnessFactor) { var xCount = (vecb.x - veca.x) / scale; var yCount = (vecb.y - veca.y) / scale; }
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); }
public TriSoupBrushGenerator(IntVec3 veca, IntVec3 vecb) : this(veca, vecb, BrushFace.DEFAULT_TEXTURE) { }
public RightHexahedralBrushGenerator(IntVec3 veca, IntVec3 vecb) : this(veca, vecb, BrushFace.DEFAULT_TEXTURE) { }