Multiple Terrains

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
monkeycracks
Posts: 1029
Joined: Thu Apr 06, 2006 12:45 am
Location: Tennesee, USA
Contact:

Multiple Terrains

Post by monkeycracks »

I have another question. First I'll give code.

Code: Select all

	terrain = sm->addTerrainSceneNode("media/mps/heightmap.bmp");
    terrain->setScale(vector3df(15, 1.1f, 15));
    terrain->setMaterialFlag(EMF_LIGHTING, false);
    terrain->setMaterialTexture(1, driver->getTexture("media/txts/detailmap3.jpg"));
    terrain->setMaterialTexture(0, driver->getTexture("media/txts/grass_color.png"));
    terrain->setMaterialType(EMT_DETAIL_MAP);
    terrain->scaleTexture(1.0f, 20.0f);
    
   	terrain2 = sm->addTerrainSceneNode("media/mps/heightmap.bmp");
    terrain2->setScale(vector3df(15, 1.1f, 15));
    terrain2->setPosition(vector3df(250,-50,250));
    terrain2->setMaterialFlag(EMF_LIGHTING, false);
    terrain2->setMaterialTexture(1, driver->getTexture("media/txts/detailmap3.jpg"));
    terrain2->setMaterialTexture(0, driver->getTexture("media/txts/grass_color.png"));
    terrain2->setMaterialType(EMT_DETAIL_MAP);
    terrain2->scaleTexture(1.0f, 20.0f);
How can you add another terrain to the same triangle selector as to provide collision?
Lynxeye
Posts: 17
Joined: Thu Jul 27, 2006 12:19 pm
Location: Germany
Contact:

Post by Lynxeye »

You have to create a MetaTriangleSelector. Then you can attach the Selectors of the 2 Terrainpages to it and do collision detection with the MetaTriSelector.
monkeycracks
Posts: 1029
Joined: Thu Apr 06, 2006 12:45 am
Location: Tennesee, USA
Contact:

Post by monkeycracks »

thx, that did it
Post Reply