star-3d

Surface structuring for efficient 3D geometric queries
git clone git://git.meso-star.fr/star-3d.git
Log | Files | Refs | README | LICENSE

s3d_shape_c.h (1406B)


      1 /* Copyright (C) 2015-2023 |Méso|Star> (contact@meso-star.com)
      2  *
      3  * This program is free software: you can redistribute it and/or modify
      4  * it under the terms of the GNU General Public License as published by
      5  * the Free Software Foundation, either version 3 of the License, or
      6  * (at your option) any later version.
      7  *
      8  * This program is distributed in the hope that it will be useful,
      9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
     10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
     11  * GNU General Public License for more details.
     12  *
     13  * You should have received a copy of the GNU General Public License
     14  * along with this program. If not, see <http://www.gnu.org/licenses/>. */
     15 
     16 #ifndef S3D_SHAPE_C_H
     17 #define S3D_SHAPE_C_H
     18 
     19 #include "s3d_mesh.h"
     20 #include "s3d_instance.h"
     21 #include "s3d_sphere.h"
     22 
     23 #include <rsys/dynamic_array_u32.h>
     24 #include <rsys/dynamic_array_float.h>
     25 #include <rsys/list.h>
     26 #include <rsys/mutex.h>
     27 #include <rsys/ref_count.h>
     28 
     29 #include <limits.h>
     30 
     31 struct s3d_shape {
     32   struct fid id;
     33 
     34   char flip_surface;
     35   char is_enabled;
     36   enum geometry_type type;
     37 
     38   union {
     39     struct instance* instance;
     40     struct mesh* mesh;
     41     struct sphere* sphere;
     42   } data;
     43 
     44   struct s3d_device* dev;
     45   ref_T ref;
     46 };
     47 
     48 /* Create an Untyped shape */
     49 extern LOCAL_SYM res_T
     50 shape_create
     51   (struct s3d_device* dev,
     52    struct s3d_shape** shape);
     53 
     54 #endif /* S3D_SHAPE_C_H */
     55