I have isolated the problem
Code: Select all
void Editor::Load_Scene(){
matrix4 projMat;
irr::f32 orth_w = (float)driver->getScreenSize().Width / (float)driver->getScreenSize().Height;
orth_w = 3 * orth_w;
projMat.buildProjectionMatrixOrthoLH(orth_w,3,1,100);
// Create target
target = smgr->addEmptySceneNode(0,200);
target->setPosition(vector3df(0,0,0));
// Add rotational camera
pivot=smgr->addEmptySceneNode(target,199);
camera[0]=smgr->addCameraSceneNode(NULL,vector3df(0,0,-2),vector3df(0,0,0));
camera[0]->setParent(pivot);
pivot->setRotation(vector3df(25,-45,0));
// Add Topdown camera
camera[1]=smgr->addCameraSceneNode(target,vector3df(0,2,-0.01),vector3df(0,0,0));
camera[1]->setProjectionMatrix(projMat,true);
// Add front camera
camera[2]=smgr->addCameraSceneNode(target,vector3df(0,0,-5),vector3df(0,0,0));
camera[2]->setProjectionMatrix(projMat,true);
// Add side camera
camera[3]=smgr->addCameraSceneNode(target,vector3df(-5,0,0));
camera[3]->setProjectionMatrix(projMat,true);
// Add Light
ILightSceneNode* light=smgr->addLightSceneNode(target,vector3df(25,50,0));
light->setLightType(ELT_POINT);
light->setRadius(2000);
// Add Plane
IMeshSceneNode* plane = smgr->addCubeSceneNode(1,0,-1,vector3df(0.5,-5.5,0.5),vector3df(0,0,0),vector3df(10,10,10));
plane->setMaterialTexture(0, driver->getTexture("texture_terrain.png"));
plane->setMaterialFlag(video::EMF_BILINEAR_FILTER, false);
plane->getMaterial(0).getTextureMatrix(0).setTextureScale(10,10);
// Add sky box
scene::IMeshSceneNode* skybox=smgr->addCubeSceneNode(50);
skybox->setMaterialTexture(0, driver->getTexture("sky.jpg"));
skybox->setMaterialFlag(video::EMF_BILINEAR_FILTER, false);
skybox->setMaterialFlag(video::EMF_LIGHTING,false);
smgr->getMeshManipulator()->flipSurfaces(skybox->getMesh());
plane_tri=smgr->createOctreeTriangleSelector(skybox->getMesh(),skybox);
}
Commenting this out causes the program to compile correctly.
More specifically, plane->getMaterial(0).getTextureMatrix(0).setTextureScale(10,10); is the problem.