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

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2015-07-22 08:49:53 +0300
committerCampbell Barton <ideasman42@gmail.com>2015-07-22 14:32:14 +0300
commitf9a6780dc642ced8dc73f82d0d76cf928c33a094 (patch)
tree5f68ab3c2d5e9bd35c212da3aa363959a3d3da30 /source/blender/editors/armature/meshlaplacian.c
parent75d1723518314632ef247ebe49f677856c8bf115 (diff)
Cleanup: use struct for storing callback data
Diffstat (limited to 'source/blender/editors/armature/meshlaplacian.c')
-rw-r--r--source/blender/editors/armature/meshlaplacian.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/source/blender/editors/armature/meshlaplacian.c b/source/blender/editors/armature/meshlaplacian.c
index 9273093e4c5..c4202539e23 100644
--- a/source/blender/editors/armature/meshlaplacian.c
+++ b/source/blender/editors/armature/meshlaplacian.c
@@ -1181,12 +1181,18 @@ static int meshdeform_tri_intersect(const float orig[3], const float end[3], con
return 1;
}
+struct MeshRayCallbackData {
+ MFace *mface;
+ MeshDeformBind *mdb;
+ MeshDeformIsect *isec;
+};
+
static void harmonic_ray_callback(void *userdata, int index, const BVHTreeRay *ray, BVHTreeRayHit *hit)
{
- void **data = userdata;
- MeshDeformBind *mdb = data[1];
- MFace *mface = data[0], *mf;
- MeshDeformIsect *isec = data[2];
+ struct MeshRayCallbackData *data = userdata;
+ MeshDeformBind *mdb = data->mdb;
+ MFace *mface = data->mface, *mf;
+ MeshDeformIsect *isec = data->isec;
float no[3], co[3], end[3], uvw[3], dist, face[4][3];
mf = mface + index;
@@ -1226,8 +1232,12 @@ static MDefBoundIsect *meshdeform_ray_tree_intersect(MeshDeformBind *mdb, const
BVHTreeRayHit hit;
MeshDeformIsect isect_mdef;
float (*cagecos)[3];
- void *data[3] = {mdb->cagedm->getTessFaceArray(mdb->cagedm), mdb, &isect_mdef};
- MFace *mface1 = data[0], *mface;
+ struct MeshRayCallbackData data = {
+ mdb->cagedm->getTessFaceArray(mdb->cagedm),
+ mdb,
+ &isect_mdef,
+ };
+ MFace *mface1 = data.mface, *mface;
float vert[4][3], len, end[3];
// static float epsilon[3] = {1e-4, 1e-4, 1e-4};
@@ -1251,7 +1261,7 @@ static MDefBoundIsect *meshdeform_ray_tree_intersect(MeshDeformBind *mdb, const
hit.index = -1;
hit.dist = FLT_MAX;
if (BLI_bvhtree_ray_cast(mdb->bvhtree, isect_mdef.start, isect_mdef.vec,
- 0.0, &hit, harmonic_ray_callback, data) != -1)
+ 0.0, &hit, harmonic_ray_callback, &data) != -1)
{
len = isect_mdef.lambda;
isect_mdef.face = mface = mface1 + hit.index;