📄 wmlnaturalspline2.h
字号:
// Magic Software, Inc.
// http://www.magic-software.com
// http://www.wild-magic.com
// Copyright (c) 2003. All Rights Reserved
//
// The Wild Magic Library (WML) source code is supplied under the terms of
// the license agreement http://www.magic-software.com/License/WildMagic.pdf
// and may not be copied or disclosed except in accordance with the terms of
// that agreement.
#ifndef WMLNATURALSPLINE2_H
#define WMLNATURALSPLINE2_H
#include "WmlMultipleCurve2.h"
namespace Wml
{
template <class Real>
class WML_ITEM NaturalSpline2 : public MultipleCurve2<Real>
{
public:
enum BoundaryType
{
BT_FREE,
BT_CLAMPED,
BT_CLOSED
};
// Construction and destruction. NaturalSpline2 accepts responsibility
// for deleting the input arrays.
NaturalSpline2 (BoundaryType eType, int iSegments, Real* afTime,
Vector2<Real>* akPoint);
virtual ~NaturalSpline2 ();
const Vector2<Real>* GetPoints () const;
virtual Vector2<Real> GetPosition (Real fTime) const;
virtual Vector2<Real> GetFirstDerivative (Real fTime) const;
virtual Vector2<Real> GetSecondDerivative (Real fTime) const;
virtual Vector2<Real> GetThirdDerivative (Real fTime) const;
protected:
void CreateFreeSpline ();
void CreateClampedSpline ();
void CreateClosedSpline ();
virtual Real GetSpeedKey (int iKey, Real fTime) const;
virtual Real GetLengthKey (int iKey, Real fT0, Real fT1) const;
virtual Real GetVariationKey (int iKey, Real fT0, Real fT1,
const Vector2<Real>& rkA, const Vector2<Real>& rkB) const;
Vector2<Real>* m_akA;
Vector2<Real>* m_akB;
Vector2<Real>* m_akC;
Vector2<Real>* m_akD;
class ThisPlusKey
{
public:
ThisPlusKey (const NaturalSpline2* pkThis, int iKey)
:
This(pkThis),
Key(iKey)
{
}
const NaturalSpline2* This;
int Key;
};
};
typedef NaturalSpline2<float> NaturalSpline2f;
typedef NaturalSpline2<double> NaturalSpline2d;
}
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -