void CRoom::setLightType(RoomLightType val) { if (val == getLightType()) return; room.set_flag_light(static_cast<mapdata::Room::RoomLightType>(val)); rebuildDisplayList(); setModified(true); }
static Light create_light(Type e) { Light l; l.type = getLightType(e); switch (e) { case directional_light: l.spot_direction = OSG::Vec3f(1.f, 0.f, 0.f); break; case point_light: l.position = OSG::Pnt3f(0.f, 0.2f, 0.f); break; case spot_light: l.position = OSG::Pnt3f(0.f, 0.2f, 0.f); l.spot_direction = OSG::Pnt3f(0.f, 0.f, 0.f) - l.position; break; default: break; } return l; }