1
// Copyright (C) 2002-2011 Nikolaus Gebhardt
2
// This file is part of the "Irrlicht Engine".
3
// For conditions of distribution and use, see copyright notice in irrlicht.h
5
#ifndef __C_SCENE_NODE_ANIMATOR_FOLLOW_SPLINE_H_INCLUDED__
6
#define __C_SCENE_NODE_ANIMATOR_FOLLOW_SPLINE_H_INCLUDED__
8
#include "ISceneNode.h"
10
#include "ISceneNodeAnimatorFinishing.h"
16
//! Scene node animator based free code Matthias Gall wrote and sent in. (Most of
17
//! this code is written by him, I only modified bits.)
18
class CSceneNodeAnimatorFollowSpline : public ISceneNodeAnimatorFinishing
23
CSceneNodeAnimatorFollowSpline(u32 startTime,
24
const core::array< core::vector3df >& points,
25
f32 speed = 1.0f, f32 tightness = 0.5f, bool loop=true, bool pingpong=false);
27
//! animates a scene node
28
virtual void animateNode(ISceneNode* node, u32 timeMs);
30
//! Writes attributes of the scene node animator.
31
virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options=0) const;
33
//! Reads attributes of the scene node animator.
34
virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options=0);
36
//! Returns type of the scene node animator
37
virtual ESCENE_NODE_ANIMATOR_TYPE getType() const { return ESNAT_FOLLOW_SPLINE; }
39
//! Creates a clone of this animator.
40
/** Please note that you will have to drop
41
(IReferenceCounted::drop()) the returned pointer after calling
43
virtual ISceneNodeAnimator* createClone(ISceneNode* node, ISceneManager* newManager=0);
47
//! clamps a the value idx to fit into range 0..size-1
48
s32 clamp(s32 idx, s32 size);
50
core::array< core::vector3df > Points;
59
} // end namespace scene
60
} // end namespace irr