htrdr_atmosphere_ground.h (3105B)
1 /* Copyright (C) 2018-2019, 2022-2025 Centre National de la Recherche Scientifique 2 * Copyright (C) 2020-2022 Institut Mines Télécom Albi-Carmaux 3 * Copyright (C) 2022-2025 Institut Pierre-Simon Laplace 4 * Copyright (C) 2022-2025 Institut de Physique du Globe de Paris 5 * Copyright (C) 2018-2025 |Méso|Star> (contact@meso-star.com) 6 * Copyright (C) 2022-2025 Observatoire de Paris 7 * Copyright (C) 2022-2025 Université de Reims Champagne-Ardenne 8 * Copyright (C) 2022-2025 Université de Versaille Saint-Quentin 9 * Copyright (C) 2018-2019, 2022-2025 Université Paul Sabatier 10 * 11 * This program is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU General Public License as published by 13 * the Free Software Foundation, either version 3 of the License, or 14 * (at your option) any later version. 15 * 16 * This program is distributed in the hope that it will be useful, 17 * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 * GNU General Public License for more details. 20 * 21 * You should have received a copy of the GNU General Public License 22 * along with this program. If not, see <http://www.gnu.org/licenses/>. */ 23 24 #ifndef HTRDR_ATMOSPHERE_GROUND_H 25 #define HTRDR_ATMOSPHERE_GROUND_H 26 27 #include <rsys/rsys.h> 28 29 /* Forward declarations */ 30 struct htrdr; 31 struct htrdr_atmosphere_ground; 32 struct htrdr_interface; 33 struct htrdr_materials; 34 struct s3d_hit; 35 struct ssf_bsdf; 36 37 extern LOCAL_SYM res_T 38 htrdr_atmosphere_ground_create 39 (struct htrdr* htrdr, 40 const char* obj_filename, /* May be NULL <=> No ground geometry */ 41 struct htrdr_materials* mats, /* May be NULL if no ground geometry */ 42 const int repeat_ground, /* Infinitely repeat the ground in X and Y */ 43 struct htrdr_atmosphere_ground** ground); 44 45 extern LOCAL_SYM void 46 htrdr_atmosphere_ground_ref_get 47 (struct htrdr_atmosphere_ground* ground); 48 49 extern LOCAL_SYM void 50 htrdr_atmosphere_ground_ref_put 51 (struct htrdr_atmosphere_ground* ground); 52 53 extern LOCAL_SYM void 54 htrdr_atmosphere_ground_get_interface 55 (struct htrdr_atmosphere_ground* ground, 56 const struct s3d_hit* hit, 57 struct htrdr_interface* interface); 58 59 extern LOCAL_SYM res_T 60 htrdr_atmosphere_ground_create_bsdf 61 (struct htrdr_atmosphere_ground* ground, 62 const size_t ithread, 63 const double wavelength, 64 const double pos[3], 65 const double dir[3], /* Incoming ray */ 66 const struct s3d_hit* hit, 67 struct htrdr_interface* interf, /* NULL <=> do not return the interface */ 68 struct ssf_bsdf** bsdf); 69 70 extern LOCAL_SYM res_T 71 htrdr_atmosphere_ground_trace_ray 72 (struct htrdr_atmosphere_ground* ground, 73 const double ray_origin[3], 74 const double ray_direction[3], /* Must be normalized */ 75 const double ray_range[2], 76 const struct s3d_hit* prev_hit,/* Previous hit. Avoid self hit. May be NULL*/ 77 struct s3d_hit* hit); 78 79 extern LOCAL_SYM res_T 80 htrdr_atmosphere_ground_find_closest_point 81 (struct htrdr_atmosphere_ground* ground, 82 const double position[3], 83 const double radius, 84 struct s3d_hit* hit); 85 86 #endif /* HTRDR_ATMOSPHERE_GROUND_H */ 87