Blender  V2.93
BKE_mesh_tangent.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 #pragma once
17 
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25 
26 struct ReportList;
27 
28 void BKE_mesh_calc_loop_tangent_single_ex(const struct MVert *mverts,
29  const int numVerts,
30  const struct MLoop *mloops,
31  float (*r_looptangent)[4],
32  float (*loopnors)[3],
33  const struct MLoopUV *loopuv,
34  const int numLoops,
35  const struct MPoly *mpolys,
36  const int numPolys,
37  struct ReportList *reports);
39  const char *uvmap,
40  float (*r_looptangents)[4],
41  struct ReportList *reports);
42 
43 void BKE_mesh_calc_loop_tangent_ex(const struct MVert *mvert,
44  const struct MPoly *mpoly,
45  const uint mpoly_len,
46  const struct MLoop *mloop,
47  const struct MLoopTri *looptri,
48  const uint looptri_len,
49 
50  struct CustomData *loopdata,
51  bool calc_active_tangent,
52  const char (*tangent_names)[64],
53  int tangent_names_len,
54  const float (*poly_normals)[3],
55  const float (*loop_normals)[3],
56  const float (*vert_orco)[3],
57  /* result */
58  struct CustomData *loopdata_out,
59  const uint loopdata_out_len,
60  short *tangent_mask_curr_p);
61 
62 void BKE_mesh_calc_loop_tangents(struct Mesh *me_eval,
63  bool calc_active_tangent,
64  const char (*tangent_names)[MAX_NAME],
65  int tangent_names_len);
66 
67 /* Helpers */
69  struct CustomData *tan_data,
70  int numLoopData,
71  const char *layer_name);
72 
73 #define DM_TANGENT_MASK_ORCO (1 << 9)
74 void BKE_mesh_calc_loop_tangent_step_0(const struct CustomData *loopData,
75  bool calc_active_tangent,
76  const char (*tangent_names)[64],
77  int tangent_names_count,
78  bool *rcalc_act,
79  bool *rcalc_ren,
80  int *ract_uv_n,
81  int *rren_uv_n,
82  char *ract_uv_name,
83  char *rren_uv_name,
84  short *rtangent_mask);
85 
86 #ifdef __cplusplus
87 }
88 #endif
void BKE_mesh_add_loop_tangent_named_layer_for_uv(struct CustomData *uv_data, struct CustomData *tan_data, int numLoopData, const char *layer_name)
Definition: mesh_tangent.c:477
void BKE_mesh_calc_loop_tangent_single_ex(const struct MVert *mverts, const int numVerts, const struct MLoop *mloops, float(*r_looptangent)[4], float(*loopnors)[3], const struct MLoopUV *loopuv, const int numLoops, const struct MPoly *mpolys, const int numPolys, struct ReportList *reports)
void BKE_mesh_calc_loop_tangent_ex(const struct MVert *mvert, const struct MPoly *mpoly, const uint mpoly_len, const struct MLoop *mloop, const struct MLoopTri *looptri, const uint looptri_len, struct CustomData *loopdata, bool calc_active_tangent, const char(*tangent_names)[64], int tangent_names_len, const float(*poly_normals)[3], const float(*loop_normals)[3], const float(*vert_orco)[3], struct CustomData *loopdata_out, const uint loopdata_out_len, short *tangent_mask_curr_p)
void BKE_mesh_calc_loop_tangents(struct Mesh *me_eval, bool calc_active_tangent, const char(*tangent_names)[MAX_NAME], int tangent_names_len)
Definition: mesh_tangent.c:748
void BKE_mesh_calc_loop_tangent_step_0(const struct CustomData *loopData, bool calc_active_tangent, const char(*tangent_names)[64], int tangent_names_count, bool *rcalc_act, bool *rcalc_ren, int *ract_uv_n, int *rren_uv_n, char *ract_uv_name, char *rren_uv_name, short *rtangent_mask)
void BKE_mesh_calc_loop_tangent_single(struct Mesh *mesh, const char *uvmap, float(*r_looptangents)[4], struct ReportList *reports)
Definition: mesh_tangent.c:181
unsigned int uint
Definition: BLI_sys_types.h:83
#define MAX_NAME
Definition: DNA_defs.h:62