56 MMechostr(MSKDEBUG,
"SO3TerrainCreate\n");
67 SScene* scene = MMgetPointer<SScene*>(m, MTOP(s));
74 std::string sname(MMstartstr(m, MTOP(name)));
75 STerrain* terrain = 0;
78 terrain = scene->CreateTerrain(sname);
80 catch (Ogre::Exception &e)
82 MMechostr(MSKDEBUG,
"An exception has occurred: %s\n", e.what());
104 MMechostr(MSKDEBUG,
"SO3TerrainDelete\n");
115 MMset(m, 0, ITOM(1));
136 MMechostr(MSKDEBUG,
"SO3TerrainSetHeightMap\n");
139 int maxbs = MTOI(MMpull(m));
140 int minbs = MTOI(MMpull(m));
141 float scale = MTOF(MMpull(m));
142 float size = MTOF(MMpull(m));
143 int file = MMpull(m);
146 if ((t == NIL) || (file == NIL))
152 string pathStd = MMstartstr(m, MTOP(file));
153 for (
unsigned int i = 0; i < pathStd.length(); i++)
155 if (pathStd.substr(i, 1) ==
"\\")
156 pathStd.replace(i, 1,
"/");
159 STerrain* terrain = MMgetPointer<STerrain*>(m, MTOP(t));
176 maxbs = minbs * 2 + 1;
178 if (!terrain->DefineHeightMap(pathStd, size, scale, minbs, maxbs))
181 MMset(m, 0, ITOM(1));
188 {
"SO3TerrainCreate", 2,
"fun [SO3_SCENE S] SO3_TERRAIN",
SO3TerrainCreate },
NativeDefinition natSO3Terrain[]
int SCOLloadTerrain(mmachine m, cbmachine w)
Load the SO3Engine Terrain function.
int SCOLfreeTerrain()
free the SO3Engine Terrain function
MMechostr(MSKDEBUG, " > Start loading Plugin SO3Engine dll\n")
SCOL_EXPORT int cbmachine w
int createTerrain(mmachine m, STerrain *terrain, SScene *curScene)
int SO3TerrainSetHeightMap(mmachine m)
SO3TerrainSetHeightMap : Define a terrain height map and params Every terrain parameters must be a va...
int SO3TerrainCreate(mmachine m)
main include
int SO3TerrainDelete(mmachine m)
SO3TerrainDelete : destroy a terrain.