Commit: 47cd57eedc337b6a5757e8765086ef8ab2479f76
Author: Campbell Barton
Date: Thu Aug 8 23:18:20 2019 +1000
Branches: master
https://developer.blender.org/rB47cd57eedc337b6a5757e8765086ef8ab2479f76
Docs: improve description of 3D view distance offset utility
===================================================================
M source/blender/editors/space_view3d/view3d_utils.c
===================================================================
diff --git a/source/blender/editors/space_view3d/view3d_utils.c
b/source/blender/editors/space_view3d/view3d_utils.c
index 5e57522eb65..7f930f1d876 100644
--- a/source/blender/editors/space_view3d/view3d_utils.c
+++ b/source/blender/editors/space_view3d/view3d_utils.c
@@ -1212,9 +1212,17 @@ float ED_view3d_radius_to_dist(const View3D *v3d,
/** \name View Distance Utilities
* \{ */
-/* problem - ofs[3] can be on same location as camera itself.
- * Blender needs proper dist value for zoom.
- * use fallback_dist to override small values
+/**
+ * This function solves the problem of having to switch between camera and
non-camera views.
+ *
+ * When viewing from the perspective of \a mat, and having the view center \a
ofs,
+ * this calculates a distance from \a ofs to the matrix \a mat.
+ * Using \a fallback_dist when the distance would be too small.
+ *
+ * \param mat: A matrix use for the view-point (typically the camera objects
matrix).
+ * \param ofs: Orbit center (negated), matching #RegionView3D.ofs, which is
typically passed in.
+ * \param fallback_dist: The distance to use if the object is too near or in
front of \a ofs.
+ * \returns A newly calculated distance or the fallback.
*/
float ED_view3d_offset_distance(float mat[4][4], const float ofs[3], const
float fallback_dist)
{
_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs