25 #ifndef PXR_BASE_TS_EVALUATOR_H
26 #define PXR_BASE_TS_EVALUATOR_H
65 std::vector<std::shared_ptr<Ts_EvalCache<T> > > _segments;
82 if (spline.
size() > 1) {
96 _segments.reserve(spline.size() - 1);
106 if (iAfterTime == spline.end()) {
110 std::shared_ptr<Ts_EvalCache<T> > segmentCache =
113 if (TF_VERIFY(segmentCache)) {
114 _segments.push_back(segmentCache);
121 template <
typename T>
128 if (!_segments.empty() && side ==
TsRight) {
132 if (time >= _spline.begin()->GetTime() &&
133 time <= _spline.rbegin()->GetTime()) {
137 if (TF_VERIFY(sample != _spline.end())) {
144 size_t idx = sample - _spline.begin();
145 if (sample->GetTime() > time && TF_VERIFY(idx > 0)) {
149 if (TF_VERIFY(idx < _segments.size())
150 && TF_VERIFY(_segments[idx])) {
151 return _segments[idx]->TypedEval(time);
158 if (!_spline.empty()) {
159 return _spline.Eval(time).template Get<T>();
GT_API const UT_StringHolder time
IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Quat< T > spline(const Quat< T > &q0, const Quat< T > &q1, const Quat< T > &q2, const Quat< T > &q3, T t) IMATH_NOEXCEPT
T Eval(const TsTime &time, TsSide side=TsRight) const
Specifies the value of an TsSpline object at a particular point in time.
Opaque interface to a spline for evaluations using cached segments.
PXR_NAMESPACE_OPEN_SCOPE typedef double TsTime
The time type used by Ts.
TsSide
Dual-value keyframe side.
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
TS_API size_t size() const
Returns the number of KeyFrames in this spline.
#define PXR_NAMESPACE_CLOSE_SCOPE
TsKeyFrameMap::const_iterator const_iterator
TsEvaluator()
Default constructor; falls back to empty spline.
#define TF_FOR_ALL(iter, c)