star-3d

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

s3d_shape_c.h (1433B)


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