public MobileChunkCollidable(MobileChunkShape shape) { ChunkShape = shape; base.Shape = ChunkShape; Vector3 max = new Vector3(shape.ChunkSize.X, shape.ChunkSize.Y, shape.ChunkSize.Z); boundingBox = new BoundingBox(-max, max); Events = new ContactEventManager<EntityCollidable>(); LocalPosition = -shape.Center; }
public MobileChunkCollidable(MobileChunkShape shape) { ChunkShape = shape; base.Shape = ChunkShape; Vector3 max = new Vector3(shape.ChunkSize.X, shape.ChunkSize.Y, shape.ChunkSize.Z); boundingBox = new BoundingBox(-max, max); Events = new ContactEventManager <EntityCollidable>(); LocalPosition = -shape.Center; }
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); }
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; }