Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Proper metadata usage
#1
I need my SplineController to quickly access the radius of points along the spline. I have the math working properly but am trying to best fit it into the architecture of Curvy. 

1) Is it correct place to cached the radius values in Metadata (i.e. public class RadiusMetadata : CurvyInterpolatableMetadataBase<float> )?
    If not, what would you suggest?

2) Only RadiusMetadata of certain segments would need to be recalculated when a control point is manipulated. Will this occur using CurvySpline.SetDirty( cpOfRadiusToUpdate,...) or automagiclly by just setting the segment's LocalPosition ?
     If so, what to implement in RadiusMetadata to catch dirty notifications?
     If not, do I just implement my own RadiusMetadata.BuildCache when any of it's segment's dependent cps changes?
       (It would be nice if this 'dependency' is handling was the same one Curvy uses taking 'followUp' things into consideration. I don't want to reinvent it)
     Or what would you suggest?
Reply
#2
Hi

1) Inheriting from CurvyInterpolatableMetadataBase makes sense only if the radius value is linearly interpolable between control points. Is it the case? The meta data is stored at each control point, and in between them, a linear interpolation is applied to get the meta data value at a specific point.

2) I will look deeper into this and answer you later.

Have a nice day
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply
#3
Hi
About point 2:
There is no dirtying notification. When a CP is dirtied, the spline will get refreshed, which triggers an CurvySpline.OnRefresh event. You can listen to the meta data's spline for that event. That way, you don't have to mind about connections, follow ups or what not. In your event listener, compare the current CP's position with the one you would have cached before hand, and if different, update your meta data.
Did this help?
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Metadata interpolation tairoark 3 5 10-17-2022, 01:07 PM
Last Post: _Aka_
  Accessing Metadata from CG hucota7 1 7 02-16-2022, 08:49 PM
Last Post: _Aka_
  Metadata warnings Josenildo 4 740 07-13-2021, 12:19 AM
Last Post: p30better
Question Control Point Metadata gets cleared. DavidH 2 2,486 12-09-2019, 03:04 PM
Last Post: DavidH

Forum Jump: