diff options
author | Sebastian Parborg <darkdefende@gmail.com> | 2021-04-08 16:51:08 +0300 |
---|---|---|
committer | Sebastian Parborg <darkdefende@gmail.com> | 2021-04-08 16:52:33 +0300 |
commit | cf2baa585cc8788b29147d6e34fa8c46609e5bf9 (patch) | |
tree | e4386e1feea9e72e2994cfed3f67e201770ad91f /source/blender/blenkernel/BKE_anim_path.h | |
parent | f0317911850f07c75aa2e10e371b69b135194ac6 (diff) |
Fix T81707: Spline IK Joints "Floating" above curve
The issue was that where_on_path uses a resampled curve to get the data
from the curve. This leads to disconnects between the curve the user
sees and the evaluated location data.
To fix this we simply use the actual curve data the user can see.
The older code needed a cleanup either way as there were hacks in other
parts of the code trying to work around some brokenness. This is now
fixed and we no longer need to clamp the evaluation range to 0-1 or make
helper functions to make it do what we actually want.
Reviewed By: Campbell, Sybren
Differential Revision: http://developer.blender.org/D10898
Diffstat (limited to 'source/blender/blenkernel/BKE_anim_path.h')
-rw-r--r-- | source/blender/blenkernel/BKE_anim_path.h | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/source/blender/blenkernel/BKE_anim_path.h b/source/blender/blenkernel/BKE_anim_path.h index ae2d13530ed..9db63080fd9 100644 --- a/source/blender/blenkernel/BKE_anim_path.h +++ b/source/blender/blenkernel/BKE_anim_path.h @@ -26,22 +26,28 @@ extern "C" { #endif -struct ListBase; +struct CurveCache; struct Object; -struct Path; /* ---------------------------------------------------- */ /* Curve Paths */ -void free_path(struct Path *path); -void calc_curvepath(struct Object *ob, struct ListBase *nurbs); -bool where_on_path(const struct Object *ob, - float ctime, - float r_vec[4], - float r_dir[3], - float r_quat[4], - float *r_radius, - float *r_weight); +int BKE_anim_path_get_array_size(const struct CurveCache *curve_cache); +float BKE_anim_path_get_length(const struct CurveCache *curve_cache); + +/* This function populates the 'ob->runtime.curve_cache->anim_path_accum_length' data. + * You should never have to call this manually as it should already have been called by + * 'BKE_displist_make_curveTypes'. Do not call this manually unless you know what you are doing. + */ +void BKE_anim_path_calc_data(struct Object *ob); + +bool BKE_where_on_path(const struct Object *ob, + float ctime, + float r_vec[4], + float r_dir[3], + float r_quat[4], + float *r_radius, + float *r_weight); #ifdef __cplusplus } |