(edit : im using core 300), i have my terrain created with irrlicht so if i understand well, i just need to make a "collision layer" with newton so my terrain show with irrlicht and it is solid in the NewtonWorld with NewtonCreateHeightFieldCollision.
//i init newton at the begining of my main with irrlicht initialization
- Code: Select all
NewtonWorld*nWorld=NewtonCreate();
//i put this code after having created my terrain
- Code: Select all
NewtonCollision* nTerrainCol = NewtonCreateHeightFieldCollision(nWorld,102400,33,0,0,"heightmap/F18.bmp",1.0f,1.0f);
//NewtonBody* nTerrain=NewtonCreateDynamicBody(nWorld, nTerrainCol,0);
NewtonDestroyCollision(nTerrainCol);
//close newton after my device->drop()
- Code: Select all
NewtonDestroy(nWorld);
1/ then what ? im pretty sure i miss lot of things and i read tutos and codes but i have difficulties making the difference between stuffs usefull to newton to work and other stuffs.
2/ i guess i dont need to createbody since irrlicht do it, right ? i think my only problem with irrlicht will be updating position of the stuff rendered with irrlicht and the newton CollisionStuff at the same time but its maybe too soon to think about it lol.
3/
unsigned short* elevationMap - the actual elevation map as 16-bit integer array.
Creates a height field collision with the specified elevation map and attributes.
what is an elevation map ? i dont understand the purpose of it.
4/ i use a bitmap 256x256 and irrlicht multiply that i think so :
core::vector3df(400.0f,33.0f,300.0f), //scale 256x400=102400 256x300=76800 height to define
is it right to put 102400 as value for newton ?
5/ i saw in the forum that some user use it like NewtonCreateHeightFieldCollision(nWorld,"filename",0) but i dont get it anyway, it just made me think about another question, in the demo you use raw, does newton recognize the .bmp format ?
and do i need to save my file as 16bits ? i think i read something about it in the tuto.
thx.