public Crate(Vector3 position) : base("Crate", PlayState.ComponentManager.RootComponent, Matrix.CreateTranslation(position), new Vector3(0.75f, 0.5f, 1.5f), new Vector3(0.5f, 0.5f, 1.0f)) { Texture2D spriteSheet = TextureManager.GetTexture(ContentPaths.Terrain.terrain_tiles); Box crateModel = new Box(PlayState.ComponentManager, "Cratebox", this, Matrix.CreateRotationY(MathFunctions.Rand(-0.25f, 0.25f)), new Vector3(1.0f, 1.0f, 1.0f), new Vector3(0.5f, 0.5f, 0.5f), PrimitiveLibrary.BoxPrimitives["crate"], spriteSheet); Tags.Add("Crate"); CollisionType = CollisionManager.CollisionType.Static; }
public Bed(Vector3 position) : base("Bed", PlayState.ComponentManager.RootComponent, Matrix.CreateTranslation(position), new Vector3(1.5f, 0.5f, 0.75f), new Vector3(-0.5f + 1.5f * 0.5f, -0.5f + 0.25f, -0.5f + 0.75f * 0.5f)) { Texture2D spriteSheet = TextureManager.GetTexture(ContentPaths.Entities.Furniture.bedtex); bedModel = new Box(PlayState.ComponentManager, "bedbox", this, Matrix.CreateTranslation(-0.5f, -0.5f, -0.5f) * Matrix.CreateRotationY((float)Math.PI * 0.5f), new Vector3(1.0f, 1.0f, 2.0f), new Vector3(0.5f, 0.5f, 1.0f), PrimitiveLibrary.BoxPrimitives["bed"], spriteSheet); Voxel voxelUnder = new Voxel(); if (PlayState.ChunkManager.ChunkData.GetFirstVoxelUnder(position, ref voxelUnder)) { VoxelListener listener = new VoxelListener(PlayState.ComponentManager, this, PlayState.ChunkManager, voxelUnder); } Tags.Add("Bed"); CollisionType = CollisionManager.CollisionType.Static; }
// 20 x 8 x 32 public Bookshelf(Vector3 position) : base("Bookshelf", PlayState.ComponentManager.RootComponent, Matrix.CreateTranslation(position), new Vector3(32.0f / 32.0f, 8.0f / 32.0f, 20.0f / 32.0f), new Vector3(0.5f, 0.5f, 0.5f)) { Texture2D spriteSheet = TextureManager.GetTexture(ContentPaths.Entities.Furniture.bookshelf); bedModel = new Box(PlayState.ComponentManager, "model", this, Matrix.CreateTranslation(new Vector3(-20.0f / 64.0f, -32.0f / 64.0f, -8.0f / 64.0f)), new Vector3(32.0f / 32.0f, 8.0f / 32.0f, 20.0f / 32.0f), new Vector3(0.0f, 0.0f, 0.0f), PrimitiveLibrary.BoxPrimitives["bookshelf"], spriteSheet); Voxel voxelUnder = new Voxel(); if (PlayState.ChunkManager.ChunkData.GetFirstVoxelUnder(position, ref voxelUnder)) { VoxelListener listener = new VoxelListener(PlayState.ComponentManager, this, PlayState.ChunkManager, voxelUnder); } Tags.Add("Books"); CollisionType = CollisionManager.CollisionType.Static; }