1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-30 22:45:36 +00:00

Add base typed B-Spline interpolators

This commit is contained in:
Alexei Kotov 2024-05-13 00:20:32 +03:00
parent 5c6fca14c1
commit d458c07b36
4 changed files with 57 additions and 0 deletions

View file

@ -807,4 +807,30 @@ namespace Nif
mBasisData.post(nif); mBasisData.post(nif);
} }
void NiBSplineFloatInterpolator::read(NIFStream* nif)
{
NiBSplineInterpolator::read(nif);
nif->read(mValue);
nif->read(mHandle);
}
void NiBSplinePoint3Interpolator::read(NIFStream* nif)
{
NiBSplineInterpolator::read(nif);
nif->read(mValue);
nif->read(mHandle);
}
void NiBSplineTransformInterpolator::read(NIFStream* nif)
{
NiBSplineInterpolator::read(nif);
nif->read(mValue);
nif->read(mTranslationHandle);
nif->read(mRotationHandle);
nif->read(mScaleHandle);
}
} }

View file

@ -560,5 +560,34 @@ namespace Nif
void post(Reader& nif) override; void post(Reader& nif) override;
}; };
// Abstract
struct NiBSplineFloatInterpolator : public NiBSplineInterpolator
{
float mValue;
uint32_t mHandle;
void read(NIFStream* nif) override;
};
// Abstract
struct NiBSplinePoint3Interpolator : public NiBSplineInterpolator
{
osg::Vec3f mValue;
uint32_t mHandle;
void read(NIFStream* nif) override;
};
struct NiBSplineTransformInterpolator : public NiBSplineInterpolator
{
NiQuatTransform mValue;
uint32_t mTranslationHandle;
uint32_t mRotationHandle;
uint32_t mScaleHandle;
void read(NIFStream* nif) override;
};
} }
#endif #endif

View file

@ -164,6 +164,7 @@ namespace Nif
{ "NiLightRadiusController", &construct<NiFloatInterpController, RC_NiLightRadiusController> }, { "NiLightRadiusController", &construct<NiFloatInterpController, RC_NiLightRadiusController> },
// Interpolators, Gamebryo // Interpolators, Gamebryo
{ "NiBSplineTransformInterpolator", &construct<NiBSplineTransformInterpolator, RC_NiBSplineTransformInterpolator> },
{ "NiBlendBoolInterpolator", &construct<NiBlendBoolInterpolator, RC_NiBlendBoolInterpolator> }, { "NiBlendBoolInterpolator", &construct<NiBlendBoolInterpolator, RC_NiBlendBoolInterpolator> },
{ "NiBlendFloatInterpolator", &construct<NiBlendFloatInterpolator, RC_NiBlendFloatInterpolator> }, { "NiBlendFloatInterpolator", &construct<NiBlendFloatInterpolator, RC_NiBlendFloatInterpolator> },
{ "NiBlendPoint3Interpolator", &construct<NiBlendPoint3Interpolator, RC_NiBlendPoint3Interpolator> }, { "NiBlendPoint3Interpolator", &construct<NiBlendPoint3Interpolator, RC_NiBlendPoint3Interpolator> },

View file

@ -164,6 +164,7 @@ namespace Nif
RC_NiBSParticleNode, RC_NiBSParticleNode,
RC_NiBSplineData, RC_NiBSplineData,
RC_NiBSplineBasisData, RC_NiBSplineBasisData,
RC_NiBSplineTransformInterpolator,
RC_NiCamera, RC_NiCamera,
RC_NiClusterAccumulator, RC_NiClusterAccumulator,
RC_NiCollisionObject, RC_NiCollisionObject,