Welcome to mirror list, hosted at ThFree Co, Russian Federation.

DNA_hair_types.h « makesdna « blender « source - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 9a42259ec2ddb46469e7d3be12c54851faa6cd82 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
/*
 * ***** BEGIN GPL LICENSE BLOCK *****
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software  Foundation,
 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 *
 * Contributor(s): Blender Foundation
 *
 * ***** END GPL LICENSE BLOCK *****
 *
 */

/** \file DNA_hair_types.h
 *  \ingroup DNA
 */

#ifndef __DNA_HAIR_TYPES_H__
#define __DNA_HAIR_TYPES_H__

#include "DNA_defs.h"
#include "DNA_listBase.h"
#include "DNA_ID.h"
#include "DNA_meshdata_types.h"

#ifdef __cplusplus
extern "C" {
#endif

/* Root point (follicle) of a hair on a surface */
typedef struct HairFollicle {
	/* Sample on the scalp mesh for the root vertex */
	MeshSample mesh_sample;
	/* Parent curve indices for shape interpolation */
	unsigned int parent_index[4];
	/* Parent curve weights for shape interpolation */
	float parent_weight[4];
} HairFollicle;

/* Collection of hair roots on a surface */
typedef struct HairPattern {
	struct HairFollicle *follicles;
	int num_follicles;
	int pad;
} HairPattern;

typedef struct HairGuideCurve {
	/* Sample on the scalp mesh for the root vertex */
	MeshSample mesh_sample;
	/* Offset in the vertex array where the curve starts */
	int vertstart;
	/* Number of vertices in the curve */
	int numverts;
} HairGuideCurve;

typedef struct HairGuideVertex {
	int flag;
	float co[3];
} HairGuideVertex;

typedef struct HairSystem {
	int flag;
	int pad;
	
	/* Set of hair follicles on the scalp mesh */
	struct HairPattern *pattern;
	
	/* Curves for guiding hair fibers */
	struct HairGuideCurve *curves;
	/* Control vertices on guide curves */
	struct HairGuideVertex *verts;
	/* Number of guide curves */
	int totcurves;
	/* Number of guide curve vertices */
	int totverts;
	
	/* Material used for drawing and rendering hair fibers */
	int material_index;
	int pad2;
	
	/* Data buffers for drawing */
	void *draw_batch_cache;
	/* Texture buffer for drawing */
	void *draw_texture_cache;
} HairSystem;

typedef enum eHairSystemFlag
{
	/* Guide curves vertices have been changed, recalc buffer offsets */
	HAIR_SYSTEM_UPDATE_GUIDE_VERT_OFFSET = (1 << 8),
	/* Guide curve positions have changed, rebind hair follicles */
	HAIR_SYSTEM_UPDATE_FOLLICLE_BINDING = (1 << 9),
} eHairSystemFlag;

typedef struct HairDrawSettings
{
	short follicle_mode;
	short pad1;
	int pad2;
} HairDrawSettings;

typedef enum eHairDrawFollicleMode
{
	HAIR_DRAW_FOLLICLE_NONE     = 0,
	HAIR_DRAW_FOLLICLE_POINTS   = 1,
	HAIR_DRAW_FOLLICLE_AXES     = 2,
} eHairDrawFollicleMode;

#ifdef __cplusplus
}
#endif

#endif /* __DNA_HAIR_TYPES_H__ */