- if (globals->get_scenery()->get_elevation_m(SGGeod::fromGeodM(inpos, 3000), height_m, &_material,0)){
+ const simgear::BVHMaterial* mat = 0;
+ if (globals->get_scenery()->get_elevation_m(SGGeod::fromGeodM(inpos, 3000), height_m, &mat, 0)){
+ const SGMaterial* material = dynamic_cast<const SGMaterial*>(mat);