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:
authorAntony Riakiotakis <kalast@gmail.com>2013-12-18 20:34:02 +0400
committerAntony Riakiotakis <kalast@gmail.com>2013-12-18 20:34:02 +0400
commit9efef3c2515bef9cd2928834ab7e29cf32c20593 (patch)
tree751a028d8ba77fcb14838d15c146352a9ccba9b4 /source/blender/blenkernel/BKE_pbvh.h
parent355c699dc6b6e95ef9305100a62efa7e70ae93ec (diff)
Fix T37177, sculpting can act on opposite side of mesh in orthographic camera.
Summary: Issue here most probably is that the start point in ray-casting is too far away from the mesh. As a result the triangle intersection code can sometimes miss the ray intersection. To solve this, we project the ray segment to the boundary of the root node. Reviewers: brecht, sergey, campbellbarton Reviewed By: brecht Maniphest Tasks: T37177 Differential Revision: http://developer.blender.org/D115
Diffstat (limited to 'source/blender/blenkernel/BKE_pbvh.h')
-rw-r--r--source/blender/blenkernel/BKE_pbvh.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_pbvh.h b/source/blender/blenkernel/BKE_pbvh.h
index f8c21a1fa16..7ef120e26af 100644
--- a/source/blender/blenkernel/BKE_pbvh.h
+++ b/source/blender/blenkernel/BKE_pbvh.h
@@ -97,6 +97,12 @@ int BKE_pbvh_node_raycast(PBVH *bvh, PBVHNode *node, float (*origco)[3], int use
const float ray_start[3], const float ray_normal[3],
float *dist);
+/* for orthographic cameras, project the far away ray segment points to the root node so
+ * we can have better precision. Warning, this function assumes that ray begins and ends outside
+ * bounding box! */
+void BKE_pbvh_raycast_project_ray_root(PBVH *bvh, bool original, float ray_start[3],
+ float ray_end[3], float ray_normal[3]);
+
/* Drawing */
void BKE_pbvh_node_draw(PBVHNode *node, void *data);