public BlockGroupEntity(Region tregion, BGETraceMode mode, BlockInternal[] blocks, int xwidth, int ywidth, int zwidth, Location sOffs) : base(tregion, true, true) { SetMass(blocks.Length); XWidth = xwidth; YWidth = ywidth; ZWidth = zwidth; Blocks = blocks; TraceMode = mode; if (TraceMode == BGETraceMode.PERFECT) { Vector3 shoffs; Shape = new MobileChunkShape(new Vector3i(xwidth, ywidth, zwidth), blocks, out shoffs); } else { Shape = CalculateHullShape(out shapeOffs); } SysConsole.Output(OutputType.INFO, "Shape offs : " + shapeOffs + " vs " + sOffs); shapeOffs = sOffs; }
public BlockGroupEntity(Location baseloc, BGETraceMode mode, Region tregion, BlockInternal[] blocks, int xwidth, int ywidth, int zwidth, Location torigin = default(Location)) : base(tregion) { SetMass(blocks.Length * 10f); XWidth = xwidth; YWidth = ywidth; ZWidth = zwidth; Blocks = blocks; TraceMode = mode; Origin = torigin; if (TraceMode == BGETraceMode.PERFECT) { Vector3 shoffs; Shape = new MobileChunkShape(new Vector3i(xwidth, ywidth, zwidth), blocks, out shoffs); // TODO: Anything offset related needed here? shapeOffs = -new Location(shoffs); } else { Shape = CalculateHullShape(out shapeOffs); shapeOffs = -shapeOffs; } SetPosition(baseloc - shapeOffs); }