| 347 | } |
| 348 | |
| 349 | static material_type eval_material_func(function material_func, vector3 p) { |
| 350 | SCM pscm = ctl_convert_vector3_to_scm(p); |
| 351 | material_type material; |
| 352 | SCM mo; |
| 353 | |
| 354 | mo = gh_call1(material_func, pscm); |
| 355 | material_type_input(mo, &material); |
| 356 | |
| 357 | while (material.which_subclass == MTS::MATERIAL_FUNCTION) { |
| 358 | material_type m; |
| 359 | |
| 360 | mo = gh_call1(material.subclass.material_function_data->material_func, pscm); |
| 361 | material_type_input(mo, &m); |
| 362 | material_type_destroy(material); |
| 363 | material = m; |
| 364 | } |
| 365 | |
| 366 | if (material.which_subclass == MTS::MATERIAL_TYPE_SELF) { epsilon_file_material(material, p); } |
| 367 | CK(material.which_subclass != MTS::MATERIAL_FUNCTION, "infinite loop in material functions"); |
| 368 | |
| 369 | return material; |
| 370 | } |
| 371 | |
| 372 | static int variable_material(int which_subclass) { |
| 373 | return (which_subclass == MTS::MATERIAL_FUNCTION); |
no test coverage detected