Exemplo n.º 1
0
 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;
 }
Exemplo n.º 2
0
        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;
        }
Exemplo n.º 3
0
 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);
 }
Exemplo n.º 4
0
 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;
 }