windows-nt/Source/XPSP1/NT/multimedia/directx/dxg/ref8/hop/bezier.hpp
2020-09-26 16:20:57 +08:00

37 lines
933 B
C++

/*============================================================================
*
* Copyright (C) 1999-2000 Microsoft Corporation. All Rights Reserved.
*
* File: bezier.hpp
* Content: Declarations for Beziers
*
****************************************************************************/
#ifndef _BEZIER_HPP
#define _BEZIER_HPP
#include "bspline.hpp"
class RDBezier : public RDBSpline
{
public:
RDBezier(DWORD dwOrderU, DWORD dwOrderV);
virtual double TexCoordU(double u) const;
virtual double TexCoordV(double v) const;
private:
double m_lut[13][13];
virtual double Basis(unsigned i, unsigned n, double t) const;
virtual double BasisPrime(unsigned i, unsigned n, double t) const;
unsigned factorial(unsigned k) const
{
_ASSERT(k < 13, "Factorial out of range");
for(unsigned i = 1, t = 1; i <= k; t *= i++);
return t;
}
};
#endif // _BEZIER_HPP