Esempio n. 1
0
        void LoadTerrain()
        {
            terrainArgument = new TerrainEngine.TerrainArguments();
            terrainArgument.heightMap = LoadedResources.Tex2dList[level_load_list["Terrain"]];

            terrainArgument.terrainTexture1 = LoadedResources.Tex2dList[level_load_list["TerrainTexture1"]];
            terrainArgument.terrainTexture2 = LoadedResources.Tex2dList[level_load_list["TerrainTexture2"]];
            terrainArgument.terrainTexture3 = LoadedResources.Tex2dList[level_load_list["TerrainTexture3"]];
            terrainArgument.terrainTexture4 = LoadedResources.Tex2dList[level_load_list["TerrainTexture4"]];
            terrainArgument.decalTexture = LoadedResources.Tex2dList[level_load_list["DecalTexture"]];
            terrainArgument.skyTexture = LoadedResources.Tex2dList[level_load_list["SkyTexture"]];
            String key = level_load_list["SkyDome"];
            terrainArgument.skyDome = LoadedResources.ModelList[key].Model_rez;

            terrainArgument.terrainScale = myLevel.terrainScale;

            terrainEngine = new TerrainEngine(this, mouseCamera, terrainArgument);

            terrainEngine.LoadContent();

            terrainActor = new TriangleMeshActor(this, new Vector3(0,0,0), new Vector3(1, 1, 1),
                terrainEngine.vertices, terrainEngine.indices);
            terrainActor.Body.Immovable = true;

            Components.Add(terrainActor);

            TerrainFrame = terrainActor.Skin.GetLocalSkinWireframe();
            terrainActor.Body.TransformWireframe(TerrainFrame);
        }
Esempio n. 2
0
        void LoadTerrain()
        {
            ResourceList LR = parentGame.LoadedResources;
            Dictionary<string, string> LLL = parentGame.Level_Loader.GetLevelLoadList();

            TerrainEngine.TerrainArguments terrainArgument = new TerrainEngine.TerrainArguments();

            terrainArgument.heightMap =         LR.Tex2dList[LLL["Terrain"]];

            terrainArgument.terrainTexture1 = LR.Tex2dList[LLL["TerrainTexture1"]];
            terrainArgument.terrainTexture2 = LR.Tex2dList[LLL["TerrainTexture2"]];
            terrainArgument.terrainTexture3 = LR.Tex2dList[LLL["TerrainTexture3"]];
            terrainArgument.terrainTexture4 = LR.Tex2dList[LLL["TerrainTexture4"]];
            terrainArgument.decalTexture =      LR.Tex2dList[LLL["DecalTexture"]];
            terrainArgument.skyTexture =        LR.Tex2dList[LLL["SkyTexture"]];
            terrainArgument.skyDome =           LR.ModelList[LLL["SkyDome"]].Model_rez;

            terrainArgument.terrainScale = parentGame.Level_Loader.myLevel.terrainScale;

            terrainEngine = new TerrainEngine(
                parentGame,
                MouseCam,
                terrainArgument);
            terrainEngine.LoadContent();

            terrainActor = new TriangleMeshActor(
                parentGame,
                new Vector3(terrainEngine.heightmapPosition.X, 0, terrainEngine.heightmapPosition.Z),
                terrainEngine.terrainScale,
                terrainEngine.heightMap,
                terrainEngine.heightData);
            terrainActor.Body.Immovable = true;
            //terrainActor.Skin.callbackFn += new CollisionCallbackFn(handleCollisionDetection);

            parentGame.Components.Add(terrainActor);
        }