public virtual void Add(Block3D item) { if (item != null) { Blocks.Add(item); } }
public static void WriteBlock3D(this GenericWriter writer, Block3D b) { writer.Write(b.X); writer.Write(b.Y); writer.Write(b.Z); writer.Write(b.H); }
public static IEnumerable <Block3D> Flatten(this IEnumerable <Block3D> blocks) { foreach (var o in blocks.ToLookup(o => o.ToPoint2D())) { var v = new Block3D(o.Key.X, o.Key.Y, o.Min(b => b.Z), 0); v.H = o.Max(b => b.Z + b.H) - v.Z; yield return(v); } }
public virtual bool Remove(Block3D item) { if (item == null) { return(false); } var success = Blocks.Remove(item); Blocks.Free(false); return(success); }
public static Wireframe GetWireframe(this MultiComponentList mcl) { if (mcl == null) { return(Wireframe.Empty); } var frame = new Block3D[mcl.List.Length]; frame.SetAll( i => new Block3D( mcl.List[i].m_OffsetX, mcl.List[i].m_OffsetY, mcl.List[i].m_OffsetZ, TileData.ItemTable[mcl.List[i].m_ItemID].CalcHeight + 5)); return(new Wireframe(frame)); }
public static Wireframe GetWireframe(this MultiComponentList mcl) { if (mcl == null) { return(Wireframe.Empty); } var frame = new Block3D[mcl.List.Length]; frame.SetAll( i => { var o = mcl.List[i]; var h = Math.Max(5, TileData.ItemTable[o.m_ItemID].Height); return(new Block3D(o.m_OffsetX, o.m_OffsetY, o.m_OffsetZ, h)); }); return(new Wireframe(frame)); }
public static bool Intersects(this IEntity e, IPoint3D o) { return(Block3D.Intersects(e, o)); }
public Wireframe(int capacity) { Blocks = new Block3D[capacity]; }
public bool Intersects(Block3D b) { return(Intersects(b.X, b.Y, b.Z, b.H)); }
public virtual bool Remove(Block3D item) { return(Blocks.Remove(item)); }
public virtual void Add(Block3D item) { Blocks.Add(item); }