LightID Stage::new_light(LightType type) { LightID lid = LightManager::manager_new(); Light& l = light(lid); l.set_type(type); signal_light_created_(lid); return lid; }
LightID Stage::new_light(Object &parent, LightType type) { LightID lid = LightManager::manager_new(); { auto l = light(lid); l->set_type(type); l->set_parent(&parent); } signal_light_created_(lid); return lid; }
LightID Stage::new_light(LightType type) { LightID lid = LightManager::manager_new(); light(lid)->set_type(type); // If this is a new directional light, make sure we set a decent // direction to start with so that users can get a decent // effect without doing anything if(type == LIGHT_TYPE_DIRECTIONAL) { light(lid)->set_direction(kglt::Vec3(-1, -0.5, 0).normalized()); } light(lid)->set_parent(this); signal_light_created_(lid); return lid; }