Commit 0b58a6d5 authored by cutealien's avatar cutealien

Add ISceneNodeAnimator::setStartTime/getStartTime to allow resetting movement...

Add ISceneNodeAnimator::setStartTime/getStartTime to allow resetting movement animators. This should work for:
CSceneNodeAnimatorFlyStraight, CSceneNodeAnimatorFlyCircle, CSceneNodeAnimatorFollowSpline, CSceneNodeAnimatorTexture.
It's also implemented for CSceneNodeAnimatorRotation, but that one currently resets the StartTime constantly (I don't think 
it has to, but I have no tests written for animators currently so can't change that for now).


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@4675 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 6f73eca6
-------------------------- --------------------------
Changes in 1.9 (not yet released) Changes in 1.9 (not yet released)
- Add ISceneNodeAnimator::setStartTime/getStartTime to allow resetting movement animators.
- Improve speed for finalizing skinned meshes (removal of unnecessary frames after loading) (thx @ichtyander for the testmodel) - Improve speed for finalizing skinned meshes (removal of unnecessary frames after loading) (thx @ichtyander for the testmodel)
- Collada loader now instantiates camera nodes which had been ignore so far (thx @NemoStein for the test .dae) - Collada loader now instantiates camera nodes which had been ignore so far (thx @NemoStein for the test .dae)
- line2d::intersectWith has a new parameter to allow ignoring intersections with coincident lines - line2d::intersectWith has a new parameter to allow ignoring intersections with coincident lines
......
...@@ -2,9 +2,11 @@ Checklist for Irrlicht developers for doing releases. ...@@ -2,9 +2,11 @@ Checklist for Irrlicht developers for doing releases.
- PRE-BUILD TESTS: - PRE-BUILD TESTS:
- - Run tests in the tests folder - - Run tests in the tests folder
- - compile and run all examples for testing (preferably on all platforms, - - Compile and run all examples for testing (preferably on all platforms,
compilers, settings ... until you are certain enough stuff works sufficiently). compilers, settings ... until you are certain enough stuff works sufficiently).
Ask for help for platforms which you don't own. Ask for help for platforms which you don't own.
- - Compile the tools on all platforms you have. Note that some tools are in the buildall-examples VS project files on Windows, but on Linux
command line you have to compile them individually.
- VERSION UPDATES: - VERSION UPDATES:
- - check IRRLICHT_SDK_VERSION (in IrrCompileConfig.h) - - check IRRLICHT_SDK_VERSION (in IrrCompileConfig.h)
......
...@@ -68,6 +68,24 @@ namespace scene ...@@ -68,6 +68,24 @@ namespace scene
{ {
return false; return false;
} }
//! Reset a time-based movement by changing the starttime.
/** By default most animators start on object creation.
Commonly you will use irr::ITimer::getTime().
This value is ignored by animators which don't work with a starttime.
CSceneNodeAnimatorRotation currently overwrites this value constantly (might be changed in the future).
*/
virtual void setStartTime(u32 time)
{
}
//! Get the starttime.
/** This will return 0 for by animators which don't work with a starttime. */
virtual irr::u32 getStartTime() const
{
return 0;
}
}; };
......
...@@ -74,7 +74,6 @@ void CSceneNodeAnimatorFlyCircle::deserializeAttributes(io::IAttributes* in, io: ...@@ -74,7 +74,6 @@ void CSceneNodeAnimatorFlyCircle::deserializeAttributes(io::IAttributes* in, io:
Radius = in->getAttributeAsFloat("Radius"); Radius = in->getAttributeAsFloat("Radius");
Speed = in->getAttributeAsFloat("Speed"); Speed = in->getAttributeAsFloat("Speed");
Direction = in->getAttributeAsVector3d("Direction"); Direction = in->getAttributeAsVector3d("Direction");
StartTime = 0;
if (Direction.equals(core::vector3df(0,0,0))) if (Direction.equals(core::vector3df(0,0,0)))
Direction.set(0,1,0); // irrlicht 1.1 backwards compatibility Direction.set(0,1,0); // irrlicht 1.1 backwards compatibility
......
...@@ -38,6 +38,18 @@ namespace scene ...@@ -38,6 +38,18 @@ namespace scene
(IReferenceCounted::drop()) the returned pointer after calling (IReferenceCounted::drop()) the returned pointer after calling
this. */ this. */
virtual ISceneNodeAnimator* createClone(ISceneNode* node, ISceneManager* newManager=0) _IRR_OVERRIDE_; virtual ISceneNodeAnimator* createClone(ISceneNode* node, ISceneManager* newManager=0) _IRR_OVERRIDE_;
//! Reset a time-based movement by changing the starttime.
virtual void setStartTime(u32 time) _IRR_OVERRIDE_
{
StartTime = time;
}
//! Get the starttime.
virtual irr::u32 getStartTime() const _IRR_OVERRIDE_
{
return StartTime;
}
private: private:
// do some initial calculations // do some initial calculations
......
...@@ -37,6 +37,19 @@ namespace scene ...@@ -37,6 +37,19 @@ namespace scene
/** Please note that you will have to drop /** Please note that you will have to drop
(IReferenceCounted::drop()) the returned pointer after calling this. */ (IReferenceCounted::drop()) the returned pointer after calling this. */
virtual ISceneNodeAnimator* createClone(ISceneNode* node, ISceneManager* newManager=0) _IRR_OVERRIDE_; virtual ISceneNodeAnimator* createClone(ISceneNode* node, ISceneManager* newManager=0) _IRR_OVERRIDE_;
//! Reset a time-based movement by changing the starttime.
virtual void setStartTime(u32 time) _IRR_OVERRIDE_
{
StartTime = time;
}
//! Get the starttime.
virtual irr::u32 getStartTime() const _IRR_OVERRIDE_
{
return StartTime;
}
private: private:
...@@ -57,4 +70,3 @@ namespace scene ...@@ -57,4 +70,3 @@ namespace scene
} // end namespace irr } // end namespace irr
#endif #endif
...@@ -41,6 +41,18 @@ namespace scene ...@@ -41,6 +41,18 @@ namespace scene
(IReferenceCounted::drop()) the returned pointer after calling (IReferenceCounted::drop()) the returned pointer after calling
this. */ this. */
virtual ISceneNodeAnimator* createClone(ISceneNode* node, ISceneManager* newManager=0) _IRR_OVERRIDE_; virtual ISceneNodeAnimator* createClone(ISceneNode* node, ISceneManager* newManager=0) _IRR_OVERRIDE_;
//! Reset a time-based movement by changing the starttime.
virtual void setStartTime(u32 time) _IRR_OVERRIDE_
{
StartTime = time;
}
//! Get the starttime.
virtual irr::u32 getStartTime() const _IRR_OVERRIDE_
{
return StartTime;
}
protected: protected:
......
...@@ -34,6 +34,18 @@ namespace scene ...@@ -34,6 +34,18 @@ namespace scene
/** Please note that you will have to drop /** Please note that you will have to drop
(IReferenceCounted::drop()) the returned pointer after calling this. */ (IReferenceCounted::drop()) the returned pointer after calling this. */
virtual ISceneNodeAnimator* createClone(ISceneNode* node, ISceneManager* newManager=0) _IRR_OVERRIDE_; virtual ISceneNodeAnimator* createClone(ISceneNode* node, ISceneManager* newManager=0) _IRR_OVERRIDE_;
//! Reset a time-based movement by changing the starttime.
virtual void setStartTime(u32 time) _IRR_OVERRIDE_
{
StartTime = time;
}
//! Get the starttime.
virtual irr::u32 getStartTime() const _IRR_OVERRIDE_
{
return StartTime;
}
private: private:
......
...@@ -41,6 +41,18 @@ namespace scene ...@@ -41,6 +41,18 @@ namespace scene
this. */ this. */
virtual ISceneNodeAnimator* createClone(ISceneNode* node, ISceneManager* newManager=0) _IRR_OVERRIDE_; virtual ISceneNodeAnimator* createClone(ISceneNode* node, ISceneManager* newManager=0) _IRR_OVERRIDE_;
//! Reset a time-based movement by changing the starttime.
virtual void setStartTime(u32 time) _IRR_OVERRIDE_
{
StartTime = time;
}
//! Get the starttime.
virtual irr::u32 getStartTime() const _IRR_OVERRIDE_
{
return StartTime;
}
private: private:
void clearTextures(); void clearTextures();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment