public override void LoadContent(Microsoft.Xna.Framework.Content.ContentManager content) { base.LoadContent(content); BlockData.Initialize(Device, content); cam = new FirstPersonCamera(0.5f, 10); cam.Pos = new Vector3(3, 3, 13); map = new Map(Device); partition = new MapPartition(map); engine = new PhysicsEngine3D(partition); MeshBuilder mb = new MeshBuilder(Device); sphere = mb.CreateSphere(0.1f, 10, 10); marker = new MeshNode(sphere); placeType = 1; primBatch = new PrimitiveBatch(Device); }
public override void LoadContent(Microsoft.Xna.Framework.Content.ContentManager content) { base.LoadContent(content); map = new Map(Device, "startPosTest.txt"); // map = new Map(); BlockData.Initialize(Device, content); primBatch = new PrimitiveBatch(Device); MeshBuilder mb = new MeshBuilder(Device); mb.Begin(); //mb.AddCylinder(1, 1, 50); mb.AddSphere(1, 20, 20); testMesh = mb.End(); mNode = new MeshNode(testMesh); mNode.SetPivot(new Vector3(0, -1f, 0)); mNode.SetScl(new Vector3(1, 5, 1)); MeshNode child = new MeshNode(testMesh); child.SetPos(new Vector3(0, 2, 0)); MeshNode another = new MeshNode(testMesh); another.SetPos(new Vector3(0, 2, 0)); //Mesh sphere = mb.CreateSphere(0.1f, 10, 10); //startMarker = new MeshNode(sphere); //startMarker.SetPos(map.StartPos); //child.AddChild(another); //mNode.AddChild(child); }
public override void LoadContent(Microsoft.Xna.Framework.Content.ContentManager content) { base.LoadContent(content); BlockData.Initialize(Device, content); //map = new Map(Device, "Content/Levels/ramps.txt"); //Load map map = new Map(Device, "Content/Levels/Level1-1.txt"); MeshBuilder mb = new MeshBuilder(Device); buildWalls(mb, content); setupNormalMapEffect(content); if (singleplayer) { objectiveLocation = map.getNextObjective(new Vector3(-1, -1, -1)); //get first objective } partition = new MapPartition(map); player = new Player(new Vector3(map.Width/2,20,map.Depth - 2)); //spawn player initializePhysicsEngine(); //Misc initialization stuff sphere = mb.CreateSphere(1f, 10, 10); destination = mb.CreateSphere(0.5f, 12, 12); //sphere to draw at objective destination.Texture = content.Load<Texture2D>("Textures/BlockTextures/Destination"); sBatch = new SpriteBatch(Device); sf = content.Load<SpriteFont>("Fonts/Helvetica"); primBatch = new PrimitiveBatch(Device); playerColor = new Vector3((int.Parse(localPlayerName) % 5) / 5.0f, (int.Parse(localPlayerName) % 3) / 3.0f, (int.Parse(localPlayerName) % 2) / 2.0f); }
public MapPartition(Map m) { map = m; }