|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MTV3D65;
namespace gefx
{
public class Flor
{
TVMesh mFlor;
TVLandscape Land;
TVTextureFactory TextureFactory;
int IDDiffuse;
private TVTextureFactory TF;
public Flor(ref gefxs GE,string Texture, ref TVPhysics TVP)
{
TextureFactory = new TVTextureFactory();
TextureFactory.LoadTexture(Texture, "EngineFlorTexture", -1, -1);
mFlor = (TVMesh)GE.Scene.CreateMeshBuilder("EngineFlor");
mFlor.AddFloor(GE.Globals.GetTex("EngineFlorTexture"), -500.0f, -500 - 0f, 500.0f, 500.0f, 0.0f, 1, 1, true);
TVP.CreateStaticMeshBody(mFlor);
}
public Flor(ref gefxs GE, string Texture, ref TVPhysics TVP, string Hmap, ref TVScene Scene)
{
TF = new TVTextureFactory();
Land = new TVLandscape();
IDDiffuse = TF.LoadTexture(Texture, "LandDiffuseTextureXYZ", -1, -1, CONST_TV_COLORKEY.TV_COLORKEY_NO, true);
Land = Scene.CreateLandscape("TerrainBasic");
Land.SetAffineLevel(CONST_TV_LANDSCAPE_AFFINE.TV_AFFINE_HIGH);
float x1 = Land.GetLandHeight() / 2;
float z1 = Land.GetLandWidth() / 2;
Land.GenerateTerrain(Hmap,
CONST_TV_LANDSCAPE_PRECISION.TV_PRECISION_AVERAGE,
4, 4, x1, 0, z1, true);
Land.SetLightingMode(CONST_TV_LIGHTINGMODE.TV_LIGHTING_MANAGED);
Land.SetTexture(IDDiffuse, -1);
Land.SetTextureScale(4, 4, -1);
TVP.CreateStaticTerrainBody(Land);
}
public void DrawFlor()
{
if (mFlor != null)
{
mFlor.Render();
}
if (Land != null)
{
Land.Render();
}
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.