static void CreateEntitiesWhichNotSynchronizedViaNetwork() { //ground { StaticMesh staticMesh = (StaticMesh)Entities.Instance.Create( "StaticMesh", Map.Instance); staticMesh.SplitGeometry = true; staticMesh.SplitGeometryPieceSize = new Vec3(10, 10, 10); staticMesh.MeshName = "Models\\DefaultBox\\DefaultBox.mesh"; staticMesh.ForceMaterial = "Ball"; staticMesh.Position = new Vec3(0, 0, -.5f); staticMesh.Scale = new Vec3(50, 50, 1); staticMesh.CastDynamicShadows = false; staticMesh.PostCreate(); } //SkyBox { Entity skyBox = Entities.Instance.Create("SkyBox", Map.Instance); skyBox.PostCreate(); } //Light { Light light = (Light)Entities.Instance.Create("Light", Map.Instance); light.LightType = RenderLightType.Directional; light.SpecularColor = new ColorValue(1, 1, 1); light.Position = new Vec3(0, 0, 10); light.Rotation = new Angles(120, 50, 330).ToQuat(); light.PostCreate(); } }
static void CreateEntitiesWhichNotSynchronizedViaNetwork() { //ground { //create materials from the code ShaderBaseMaterial[] materials = new ShaderBaseMaterial[7]; { for (int n = 0; n < materials.Length; n++) { string materialName = HighLevelMaterialManager.Instance.GetUniqueMaterialName( "ExampleOfProceduralMapCreation_Ground"); ShaderBaseMaterial material = (ShaderBaseMaterial)HighLevelMaterialManager.Instance.CreateMaterial( materialName, "ShaderBaseMaterial"); material.Diffuse1Map.Texture = string.Format("Types\\Vegetation\\Trees\\Textures\\Bark{0}A.dds", n + 1); material.NormalMap.Texture = string.Format("Types\\Vegetation\\Trees\\Textures\\Bark{0}A_N.dds", n + 1); material.SpecularColor = new ColorValue(1, 1, 1); material.SpecularMap.Texture = string.Format("Types\\Vegetation\\Trees\\Textures\\Bark{0}A_S.dds", n + 1); material.PostCreate(); materials[n] = material; } } //create objects with collision body EngineRandom random = new EngineRandom(0); for (float y = -35; y < 35; y += 5) { for (float x = -35; x < 35; x += 2.5f) { StaticMesh staticMesh = (StaticMesh)Entities.Instance.Create("StaticMesh", Map.Instance); staticMesh.MeshName = "Base\\Simple Models\\Box.mesh"; ShaderBaseMaterial material = materials[random.Next(0, 6)]; staticMesh.ForceMaterial = material.Name; //"DarkGray"; staticMesh.Position = new Vec3(x, y, -1.0f); staticMesh.Scale = new Vec3(2.5f, 5, 2); staticMesh.CastDynamicShadows = false; staticMesh.PostCreate(); } } } //SkyBox { Entity skyBox = Entities.Instance.Create("SkyBox", Map.Instance); skyBox.PostCreate(); } //Light { Light light = (Light)Entities.Instance.Create("Light", Map.Instance); light.LightType = RenderLightType.Directional; light.SpecularColor = new ColorValue(1, 1, 1); light.Position = new Vec3(0, 0, 10); light.Rotation = new Angles(120, 50, 330).ToQuat(); light.PostCreate(); } }