示例#1
0
        public Player()
            : base(new Vector4(1, 0, 0, 1))
        {
            AABB = new AxisAlignedBoundingBox(new Vector3(-0.4f, 0f, -0.4f), new Vector3(0.4f, 1.7f, 0.4f));
            EyePosition = new Vector3(0, AABB.Max.Y - 0.1f, 0);
            Speed = 0.15f;

            Inventory.Slots[2].Content.ReplaceWith(ItemRepository.StonePickAxe.Id, 1);
            Inventory.Slots[3].Content.ReplaceWith(ItemRepository.StoneAxe.Id, 1);
            Inventory.Slots[4].Content.ReplaceWith(ItemRepository.StoneShovel.Id, 1);
            Inventory.Slots[5].Content.ReplaceWith(ItemRepository.StoneHoe.Id, 1);

            Inventory.Slots[9].Content.ReplaceWith(BlockRepository.Glass.Id, 64);
            Inventory.Slots[10].Content.ReplaceWith(BlockRepository.Water.Id, 64);

            Inventory.Slots[18].Content.ReplaceWith(BlockRepository.Wood.Id, 64);
            Inventory.Slots[19].Content.ReplaceWith(BlockRepository.Stone.Id, 64);
            Inventory.Slots[20].Content.ReplaceWith(BlockRepository.CobbleStone.Id, 64);
            Inventory.Slots[21].Content.ReplaceWith(BlockRepository.Plank.Id, 64);

            Inventory.Slots[23].Content.ReplaceWith(ItemRepository.Wheat.Id, 64);
            Inventory.Slots[24].Content.ReplaceWith(ItemRepository.SeedsWheat.Id, 64);
            Inventory.Slots[25].Content.ReplaceWith(ItemRepository.Coal.Id, 64);

            collisionSystem = new CollisionComplex(this);
        }
示例#2
0
 public EntityStack(int id, int count)
 {
     this.Id = id;
     this.count = count;
     AABB = new AxisAlignedBoundingBox(new Vector3(-0.25f, -0.25f, -0.25f), new Vector3(0.25f, 0.25f, 0.25f));
     collisionSystem = new CollisionSimple(this);
     EntityType = EntityTypeEnum.EntityStackFullUpdate;
 }
示例#3
0
 internal bool OverLaps(AxisAlignedBoundingBox alienAABB)
 {
     if (Min.X >= alienAABB.Max.X) return false;
     if (Min.Y >= alienAABB.Max.Y) return false;
     if (Min.Z >= alienAABB.Max.Z) return false;
     if (Max.X <= alienAABB.Min.X) return false;
     if (Max.Y <= alienAABB.Min.Y) return false;
     if (Max.Z <= alienAABB.Min.Z) return false;
     return true;
 }
示例#4
0
文件: Sun.cs 项目: samuto/HelloWorld
 public Sun()
     : base(new Vector4(1, 1, 0, 1))
 {
     float size = 8f;
     AABB = new AxisAlignedBoundingBox(new Vector3(-size, -2f * size, -size), new Vector3(size, 0, size));
 }
示例#5
0
 internal List<EntityStack> EntitiesInArea(AxisAlignedBoundingBox collectArea)
 {
     List<EntityStack> stacksInArea = new List<EntityStack>();
     foreach (EntityStack stack in stackEntities)
     {
         AxisAlignedBoundingBox aabb = stack.AABB;
         aabb.Translate(stack.Position);
         if (aabb.OverLaps(collectArea))
         {
             stacksInArea.Add(stack);
         }
     }
     return stacksInArea;
 }
示例#6
0
文件: Moon.cs 项目: samuto/HelloWorld
 public Moon()
     : base(new Vector4(0.8f, 0.8f, 0.8f, 1f))
 {
     float size = 5f;
     AABB = new AxisAlignedBoundingBox(new Vector3(-size, -2f * size, -size), new Vector3(size, 0, size));
 }