float PathTraversalState::cubicBezierTo(const FloatPoint& newControl1, const FloatPoint& newControl2, const FloatPoint& newEnd) { float distance = curveLength<CubicBezier>(*this, CubicBezier(m_current, newControl1, newControl2, newEnd)); if (m_action != TraversalPointAtLength && m_action != TraversalNormalAngleAtLength) m_current = newEnd; return distance; }
/** * Load the data of a Bezier spline into a #BezierTrackCurve. * @param rcdfile Data file to load from. Caller must ensure there is enough data available at the stream. * @return The Loaded Bezier spline. */ static CubicBezier LoadBezier(RcdFileReader *rcdfile) { uint32 start = rcdfile->GetUInt32(); uint32 last = rcdfile->GetUInt32(); int16 a = rcdfile->GetInt16(); int16 b = rcdfile->GetInt16(); int16 c = rcdfile->GetInt16(); int16 d = rcdfile->GetInt16(); return CubicBezier(start, last, a, b, c, d); }