📄 wmlnaturalspline3.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 WMLNATURALSPLINE3_H
#define WMLNATURALSPLINE3_H
#include "WmlMultipleCurve3.h"
namespace Wml
{
template <class Real>
class WML_ITEM NaturalSpline3 : public MultipleCurve3<Real>
{
public:
enum BoundaryType
{
BT_FREE,
BT_CLAMPED,
BT_CLOSED
};
// Construction and destruction. NaturalSpline3 accepts responsibility
// for deleting the input arrays.
NaturalSpline3 (BoundaryType eType, int iSegments, Real* afTime,
Vector3<Real>* akPoint);
virtual ~NaturalSpline3 ();
const Vector3<Real>* GetPoints () const;
virtual Vector3<Real> GetPosition (Real fTime) const;
virtual Vector3<Real> GetFirstDerivative (Real fTime) const;
virtual Vector3<Real> GetSecondDerivative (Real fTime) const;
virtual Vector3<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 fDT0, Real fDT1) const;
virtual Real GetVariationKey (int iKey, Real fT0, Real fT1,
const Vector3<Real>& rkA, const Vector3<Real>& rkB) const;
Vector3<Real>* m_akA;
Vector3<Real>* m_akB;
Vector3<Real>* m_akC;
Vector3<Real>* m_akD;
class ThisPlusKey
{
public:
ThisPlusKey (const NaturalSpline3* pkThis, int iKey)
:
This(pkThis),
Key(iKey)
{
}
const NaturalSpline3* This;
int Key;
};
};
typedef NaturalSpline3<float> NaturalSpline3f;
typedef NaturalSpline3<double> NaturalSpline3d;
}
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -