blob: b0d97e9680b9eb0bfe22b1055156940a361afbb5 (
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
|
/**
* ***** 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.
*
* Contributor(s): Miika Hämäläinen
*
* ***** END GPL LICENSE BLOCK *****
*/
#ifndef BKE_DYNAMIC_PAINT_H_
#define BKE_DYNAMIC_PAINT_H_
typedef struct FaceAdv {
float no[3];
float no_q[3];
} FaceAdv;
typedef struct BB2d {
float min[2], max[2];
} BB2d;
typedef struct Vec3f {
float v[3];
} Vec3f;
/* Actual surface point */
typedef struct PaintSurfacePoint {
/*
* Paint layer data
*/
float color[3];
float alpha;
float depth; /* displacement */
/*
* Effect / moving layer data
* ! Only generated if effects enabled !
*/
int neighbours[8]; /* Indexes of 8 neighbouring pixels if exist */
float neighbour_dist[8]; /* Distances to all 8 neighbouring pixels */
float gravity_dir; /* UV space direction of gravity */
float gravity_rate; /* Gravity strength. (Depends on surface angle.) */
/* Wet paint is handled at effect layer only
* and mixed to surface when drying */
float e_color[3];
float e_alpha;
float wetness;
short state; /* 0 = empty or dry
* 1 = wet paint
* 2 = new paint */
/*
* Pixel / mesh data
*/
int index; /* face index on domain derived mesh */
int v1, v2, v3; /* vertex indexes */
int neighbour_pixel; /* If this pixel isn't uv mapped to any face,
but it's neighbouring pixel is */
short quad;
struct Vec3f *barycentricWeights; /* b-weights for all pixel samples */
float realCoord[3]; /* current pixel center world-space coordinates */
float invNorm[3]; /*current pixel world-space inverted normal. depends on smooth/flat shading */
} PaintSurfacePoint;
typedef struct PaintSurface {
struct PaintSurfacePoint *point;
int w, h, active_points;
short pixelSamples;
} PaintSurface;
void dynamicPaint_Modifier_do(struct DynamicPaintModifierData *pmd, struct Scene *scene, struct Object *ob, struct DerivedMesh *dm);
void dynamicPaint_Modifier_free (struct DynamicPaintModifierData *pmd);
void dynamicPaint_Modifier_createType(struct DynamicPaintModifierData *pmd);
void dynamicPaint_Modifier_copy(struct DynamicPaintModifierData *pmd, struct DynamicPaintModifierData *tsmd);
#endif /* BKE_DYNAMIC_PAINT_H_ */
|