Blender  V2.93
DNA_hair_types.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  */
16 
21 #pragma once
22 
23 #include "DNA_ID.h"
24 #include "DNA_customdata_types.h"
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
30 typedef struct HairCurve {
31  /* Index of first point of hair curve. */
33  /* Number of points in hair curve, must be 2 or higher. */
34  int numpoints;
36 
37 /* Hair attachment to a mesh.
38  * TODO: attach to tessellated triangles or polygons?
39  * TODO: what type of interpolation to use for uv? */
40 typedef struct HairMapping {
41  float uv[2];
42  int poly;
44 
45 typedef struct Hair {
46  ID id;
47  struct AnimData *adt; /* animation data (must be immediately after id) */
48 
49  int flag;
50  int _pad1[1];
51 
52  /* Geometry */
53  float (*co)[3];
54  float *radius;
55  struct HairCurve *curves;
56  struct HairMaping *mapping;
57  int totpoint;
58  int totcurve;
59 
60  /* Custom Data */
61  struct CustomData pdata;
62  struct CustomData cdata;
64  int _pad3;
65 
66  /* Material */
67  struct Material **mat;
68  short totcol;
69  short _pad2[3];
70 
71  /* Draw Cache */
72  void *batch_cache;
73 } Hair;
74 
75 /* Hair.flag */
76 enum {
77  HA_DS_EXPAND = (1 << 0),
78 };
79 
80 /* Only one material supported currently. */
81 #define HAIR_MATERIAL_NR 1
82 
83 #ifdef __cplusplus
84 }
85 #endif
typedef float(TangentPoint)[2]
ID and Library types, which are fundamental for sdna.
struct HairMapping HairMapping
@ HA_DS_EXPAND
struct HairCurve HairCurve
struct Hair Hair
float uv[2]
struct Material ** mat
struct CustomData pdata
float(* co)[3]
int totcurve
int flag
int attributes_active_index
struct HairCurve * curves
float * radius
struct HairMaping * mapping
short totcol
int _pad1[1]
int _pad3
struct AnimData * adt
int totpoint
short _pad2[3]
void * batch_cache
struct CustomData cdata
Definition: DNA_ID.h:273