public override void ApplyTerrainMaterial(TerrainChunkNode chunk) { List <Geometry> geoms = Rendering.Util.RenderUtil.GatherGeometry(chunk); foreach (Geometry g in geoms) { g.Material = GetMaterial(); } }
public override TerrainChunkNode CreateNewChunk(PhysicsWorld physicsWorld, TerrainComponent parentT, int x, int z, Vector3f scale, int chunkSize, TerrainChunkNode[] neighbors) { string assetLoc = directory + "\\" + defaultName + "_" + x.ToString() + "_" + z.ToString() + defaultExt; GameObject loadedObj = null; if (System.IO.File.Exists(assetLoc)) { loadedObj = Assets.AssetManager.LoadModel(assetLoc); } else { assetLoc = directory + "\\" + defaultName + "_0_0" + defaultExt; if (System.IO.File.Exists(assetLoc)) { loadedObj = Assets.AssetManager.LoadModel(assetLoc); } } return new ModelTerrainChunkNode(loadedObj, physicsWorld, (ModelTerrainComponent)parentT, x, z, scale, chunkSize, (ModelTerrainChunkNode[])neighbors); }
public override TerrainChunkNode CreateNewChunk(PhysicsWorld physicsWorld, TerrainComponent parentT, int x, int z, Vector3f scale, int chunkSize, TerrainChunkNode[] neighbors) { return new SimplexTerrainChunkNode(physicsWorld, (SimplexTerrainComponent)parentT, x, z, scale, chunkSize, (SimplexTerrainChunkNode[])neighbors, biomesEnabled); }
public override void ApplyTerrainMaterial(TerrainChunkNode chunk) { chunk.GetChildGeom(0).Material = GetMaterial().Clone(); }
public void GenPatches(TerrainChunkNode terrain, int numPatches, int numEntityPerChunk) { GenPatches(terrain, new Vector2f(0, 0), new Vector2f(0, 0), numPatches, numEntityPerChunk, terrain.ChunkSize * terrain.Scale.x); }
public override void ApplyTerrainMaterial(TerrainChunkNode chunk) { List<Geometry> geoms = Rendering.Util.RenderUtil.GatherGeometry(chunk); foreach (Geometry g in geoms) g.Material = GetMaterial(); }