osgAnimation.TemplateCompositeSampler 是一个模板类,用于在多个样本器之间进行样本复合。它可以用于组合多个位置、旋转、颜色、浮点数和整数值的动画。
ValueType:样本值的类型。它可以是 osg::Vec3f、osg::Quat、osg::Vec4f、float 或 int。interp:插值器的类型。它可以是 osgAnimation::LinearSampler、osgAnimation::BezierSampler、osgAnimation::StepFunctionSampler、osgAnimation::CubicBezierSampler 或 osgAnimation::CubicLinearSampler。TemplateCompositeSampler():使用默认的 ValueType 和 interp 创建一个空的样本器。TemplateCompositeSampler(const TemplateCompositeSampler& copy, const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY):使用另一个 copy 的构造函数,同时使用 copyop 进行深拷贝或浅拷贝。TemplateCompositeSampler(ValueType value):使用给定的 ValueType 类型的值创建一个包含该值的样本器。TemplateCompositeSampler(const std::vector< osg::ref_ptr<Sampler> >& samplers):使用给定的多个样本器创建一个样本器。TemplateCompositeSampler(Sampler* sampler1, Sampler* sampler2):使用两个给定的样本器创建一个样本器。void addSampler(Sampler* sampler);
void addSampler(const std::vector< osg::ref_ptr<Sampler> >& samplers);
void clear();
unsigned int getNumSamplers() const;
Sampler* getSampler(unsigned int index);
const Sampler* getSampler(unsigned int index) const;
ValueType getValue(double t);
void setValue(double t, const ValueType& value);
interp* getInterpolator(double t);
void setInterpolator(double t, interp* interp);
std::pair<ValueType,interp*> getValueAndInterpolator(double t);
void setValueAndInterpolator(double t, const ValueType& value, interp* interp);