2009-01-14 04:37:51 -08:00
|
|
|
// Copyright (C) 2002-2009 Nikolaus Gebhardt
|
2007-05-20 11:03:49 -07:00
|
|
|
// This file is part of the "Irrlicht Engine".
|
|
|
|
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
|
|
|
|
|
|
|
#ifndef __C_SCENE_NODE_ANIMATOR_FLY_STRAIGHT_H_INCLUDED__
|
|
|
|
#define __C_SCENE_NODE_ANIMATOR_FLY_STRAIGHT_H_INCLUDED__
|
|
|
|
|
2008-12-19 15:21:26 -08:00
|
|
|
#include "ISceneNodeAnimatorFinishing.h"
|
2007-05-20 11:03:49 -07:00
|
|
|
|
|
|
|
namespace irr
|
|
|
|
{
|
|
|
|
namespace scene
|
|
|
|
{
|
2008-12-19 15:21:26 -08:00
|
|
|
class CSceneNodeAnimatorFlyStraight : public ISceneNodeAnimatorFinishing
|
2007-05-20 11:03:49 -07:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
//! constructor
|
2007-09-14 15:25:59 -07:00
|
|
|
CSceneNodeAnimatorFlyStraight(const core::vector3df& startPoint,
|
|
|
|
const core::vector3df& endPoint,
|
|
|
|
u32 timeForWay,
|
2009-02-05 07:33:55 -08:00
|
|
|
bool loop, u32 now, bool pingpong);
|
2007-05-20 11:03:49 -07:00
|
|
|
|
|
|
|
//! animates a scene node
|
|
|
|
virtual void animateNode(ISceneNode* node, u32 timeMs);
|
|
|
|
|
|
|
|
//! Writes attributes of the scene node animator.
|
2007-09-14 15:25:59 -07:00
|
|
|
virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options=0) const;
|
2007-05-20 11:03:49 -07:00
|
|
|
|
|
|
|
//! Reads attributes of the scene node animator.
|
|
|
|
virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options=0);
|
|
|
|
|
|
|
|
//! Returns type of the scene node animator
|
|
|
|
virtual ESCENE_NODE_ANIMATOR_TYPE getType() const { return ESNAT_FLY_STRAIGHT; }
|
2009-03-30 08:45:59 -07:00
|
|
|
|
2008-10-12 19:55:54 -07:00
|
|
|
//! Creates a clone of this animator.
|
|
|
|
/** Please note that you will have to drop
|
2009-03-30 02:18:36 -07:00
|
|
|
(IReferenceCounted::drop()) the returned pointer after calling this. */
|
2008-10-12 19:55:54 -07:00
|
|
|
virtual ISceneNodeAnimator* createClone(ISceneNode* node, ISceneManager* newManager=0);
|
2007-05-20 11:03:49 -07:00
|
|
|
|
|
|
|
private:
|
|
|
|
|
2008-12-19 15:21:26 -08:00
|
|
|
void recalculateIntermediateValues();
|
2007-05-20 11:03:49 -07:00
|
|
|
|
|
|
|
core::vector3df Start;
|
|
|
|
core::vector3df End;
|
|
|
|
core::vector3df Vector;
|
|
|
|
f32 TimeFactor;
|
|
|
|
u32 StartTime;
|
|
|
|
u32 TimeForWay;
|
|
|
|
bool Loop;
|
2009-02-05 07:33:55 -08:00
|
|
|
bool PingPong;
|
2007-05-20 11:03:49 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
} // end namespace scene
|
|
|
|
} // end namespace irr
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|