private void Load() { SetSky(); //SetFog(); SetLights(); SetShadows(); ground = new Ground(mSceneMgr); Physics.AddBoundary(ground.Plane); }
/// <summary> /// Loads everything in the environment /// </summary> private void Load() { SetLights(); SetSky(); SetFog(); SetShadows(); SetWall(); foreach (Plane p in wall.getPlanes()) { Physics.AddBoundary(p); } ground = new Ground(mSceneMgr); }
/// <summary> /// Loads the entire environment - ground, wall, sky, fog, lights, shadows /// </summary> private void Load() { ground = new Ground(mSceneMgr); wall = new Wall(mSceneMgr); SetSky(); SetFog(); SetLights(); SetShadows(); Physics.AddBoundary(ground.GetPlane); //add physics boundary to ground }
/// <summary> /// This method generates a plane in an Entity which will be used as a ground /// </summary> private void GroundPlane() { Plane plane = new Plane(Vector3.UNIT_Y, -10); MeshPtr groundMeshPtr = MeshManager.Singleton.CreatePlane("ground", ResourceGroupManager.DEFAULT_RESOURCE_GROUP_NAME, plane, groundWidth, groundHeight, groundXSegs, groundZSegs, true, 1, uTiles, vTiles, Vector3.UNIT_Z); groundEntity = mSceneMgr.CreateEntity("ground"); groundEntity.SetMaterialName("Ground"); Physics.AddBoundary(plane); //groundEntity.SetMaterialName("waterAnimated"); }
/// <summary> /// This method loads the environment /// </summary> private void Load() { SetLights(); SetFog(); SetSky(); ground = new Ground(mSceneMgr); wall = new Wall(mSceneMgr); Physics.AddBoundary(ground.Plane); Physics.AddBoundary(wall.Plane1); Physics.AddBoundary(wall.Plane2); Physics.AddBoundary(wall.Plane3); Physics.AddBoundary(wall.Plane4); }
/// <summary> /// This method loads the environment /// </summary> private void Load() { SetLights(); floor = new FloorModel(mSceneMgr); Physics.AddBoundary(floor.Plane); wall = new WallModel(mSceneMgr); //Physics.AddBoundary(wall.Plane); #region Part3 //SetShadows(); #endregion SetFog(); #region As in Demo 10 SetSky(); // ground = new Ground(mSceneMgr); #endregion }
private void SetWallBoundary() { Plane front = new Plane(Vector3.NEGATIVE_UNIT_X, -500); Physics.AddBoundary(front); Plane back = new Plane(Vector3.UNIT_Z, -500); Physics.AddBoundary(back); Plane left = new Plane(Vector3.NEGATIVE_UNIT_Z, -500); Physics.AddBoundary(left); Plane right = new Plane(Vector3.UNIT_X, -500); Physics.AddBoundary(right); }
/// <summary> /// Places invisible walls at the edge of each side of the arena so that nothing can pass through, but rather bounces off. Calls to create the walls first /// </summary> private void CreateBoundaries() { BoundaryCubes(); boundaryNode = mSceneMgr.CreateSceneNode(); boundaryNode.AttachObject(boundaryEntity); mSceneMgr.RootSceneNode.AddChild(boundaryNode); Plane pNorth = new Plane(Vector3.UNIT_Z, -500); //set to height zero Physics.AddBoundary(pNorth); Plane pSouth = new Plane(-Vector3.UNIT_Z, -500); //set to height zero Physics.AddBoundary(pSouth); Plane pEast = new Plane(Vector3.UNIT_X, -500); //set to height zero Physics.AddBoundary(pEast); Plane pWest = new Plane(-Vector3.UNIT_X, -500); //set to height zero Physics.AddBoundary(pWest); }
private void Load() { SetLights(); SetShadows(); SetSky(); SetFog(); ground = new Ground(mSceneMgr); usa = new Plane(Vector3.NEGATIVE_UNIT_X, -500); flagMeshPtr = MeshManager.Singleton.CreatePlane("flag", ResourceGroupManager.DEFAULT_RESOURCE_GROUP_NAME, usa, 60, 100, 10, 6, true, 1, 1, 1, Vector3.UNIT_Z); flagEntity = mSceneMgr.CreateEntity("flag"); flagEntity.SetMaterialName("flagMaterial"); flagNode = mSceneMgr.CreateSceneNode(); flagNode.AttachObject(flagEntity); flagNode.Position = new Vector3(0, 100, 0); fStickEntity = mSceneMgr.CreateEntity("stick.mesh"); fStickNode = mSceneMgr.CreateSceneNode(); fStickNode.AttachObject(fStickEntity); fStickNode.Position = new Vector3(501, 70, 45); mSceneMgr.RootSceneNode.AddChild(flagNode); mSceneMgr.RootSceneNode.AddChild(fStickNode); #region cube cube = new Cube(mSceneMgr); MeshPtr cubePtr = cube.getCube("myCube", "Wall", 1000, 100, 1000); cubeEntity = mSceneMgr.CreateEntity("Cube_Entity", "myCube"); cubeNode = mSceneMgr.RootSceneNode.CreateChildSceneNode("Cube_Node"); cubeNode.AttachObject(cubeEntity); wall1 = new Plane(Vector3.NEGATIVE_UNIT_X, -500); Physics.AddBoundary(wall1); wall2 = new Plane(Vector3.UNIT_X, -500); Physics.AddBoundary(wall2); wall3 = new Plane(Vector3.NEGATIVE_UNIT_Z, -500); Physics.AddBoundary(wall3); wall4 = new Plane(Vector3.UNIT_Z, -500); Physics.AddBoundary(wall4); //cube2 = new Cube(mSceneMgr); //MeshPtr cubePtr2 = cube2.getCube("myCube2", "Wall", 100, 100, 100); //cubeEntity2 = mSceneMgr.CreateEntity("Cube_Entity2", "myCube"); //cubeNode2 = mSceneMgr.RootSceneNode.CreateChildSceneNode("Cube_Node"); //cubeNode2.AttachObject(cubeEntity2); //cube3 = new Cube(mSceneMgr); //MeshPtr cubePtr3 = cube3.getCube("myCube3", "Wall", 100, 100, 100); //cubeEntity3 = mSceneMgr.CreateEntity("Cube_Entity3", "myCube"); //cubeNode3 = mSceneMgr.RootSceneNode.CreateChildSceneNode("Cube_Node"); //cubeNode3.AttachObject(cubeEntity3); //cube4 = new Cube(mSceneMgr); //MeshPtr cubePtr4 = cube4.getCube("myCube4", "Wall", 100, 100, 100); //cubeEntity4 = mSceneMgr.CreateEntity("Cube_Entity4", "myCube"); //cubeNode4 = mSceneMgr.RootSceneNode.CreateChildSceneNode("Cube_Node"); //cubeNode4.AttachObject(cubeEntity4); #endregion Physics.AddBoundary(ground.Plane); }