diff -Nauwr Irrlicht/CSceneManager.cpp Irrlicht/CSceneManager.cpp --- Irrlicht/CSceneManager.cpp 2005-08-24 18:01:14.000000000 +0200 +++ Irrlicht/CSceneManager.cpp 2005-09-27 15:50:08.000000000 +0200 @@ -805,53 +877,42 @@ //! creates a rotation animator, which rotates the attached scene node around itself. -ISceneNodeAnimator* CSceneManager::createRotationAnimator(const core::vector3df& rotationPerSecond) +ISceneNodeAnimatorRotation* CSceneManager::createRotationAnimator(const core::vector3df& rotationPerSecond) { - ISceneNodeAnimator* anim = new CSceneNodeAnimatorRotation(os::Timer::getTime(), - rotationPerSecond); - - return anim; + return new CSceneNodeAnimatorRotation(os::Timer::getTime(), rotationPerSecond); } //! creates a fly circle animator, which lets the attached scene node fly around a center. -ISceneNodeAnimator* CSceneManager::createFlyCircleAnimator(const core::vector3df& normal, +ISceneNodeAnimatorFlyCircle* CSceneManager::createFlyCircleAnimator(const core::vector3df& normal, f32 radius, f32 speed) { - ISceneNodeAnimator* anim = new CSceneNodeAnimatorFlyCircle(os::Timer::getTime(), normal, - radius, speed); - return anim; + return new CSceneNodeAnimatorFlyCircle(os::Timer::getTime(), normal, radius, speed); } //! Creates a fly straight animator, which lets the attached scene node //! fly or move along a line between two points. -ISceneNodeAnimator* CSceneManager::createFlyStraightAnimator(const core::vector3df& startPoint, - const core::vector3df& endPoint, u32 timeForWay, bool loop) +ISceneNodeAnimatorFlyStraight* CSceneManager::createFlyStraightAnimator(const core::vector3df& startPoint, + const core::vector3df& endPoint, u32 timeForWay, bool loop, bool animateToStartOnLoop) { - ISceneNodeAnimator* anim = new CSceneNodeAnimatorFlyStraight(startPoint, - endPoint, timeForWay, loop, os::Timer::getTime()); - - return anim; + return new CSceneNodeAnimatorFlyStraight(startPoint, endPoint, timeForWay, loop, animateToStartOnLoop, os::Timer::getTime()); } //! Creates a texture animator, which switches the textures of the target scene //! node based on a list of textures. -ISceneNodeAnimator* CSceneManager::createTextureAnimator(const core::array& textures, +ISceneNodeAnimatorTexture* CSceneManager::createTextureAnimator(const core::array& textures, s32 timePerFrame, bool loop) { - ISceneNodeAnimator* anim = new CSceneNodeAnimatorTexture(textures, - timePerFrame, loop, os::Timer::getTime()); - - return anim; + return new CSceneNodeAnimatorTexture(textures, timePerFrame, loop, os::Timer::getTime()); } //! Creates a scene node animator, which deletes the scene node after //! some time automaticly. -ISceneNodeAnimator* CSceneManager::createDeleteAnimator(u32 when) +ISceneNodeAnimatorDelete* CSceneManager::createDeleteAnimator(u32 when) { return new CSceneNodeAnimatorDelete(this, os::Timer::getTime() + when); } @@ -876,13 +937,12 @@ //! Creates a follow spline animator. -ISceneNodeAnimator* CSceneManager::createFollowSplineAnimator(s32 startTime, - const core::array< core::vector3df >& points, - f32 speed, f32 tightness) -{ - ISceneNodeAnimator* a = new CSceneNodeAnimatorFollowSpline(startTime, points, - speed, tightness); - return a; +ISceneNodeAnimatorFollowSpline* CSceneManager::createFollowSplineAnimator(s32 startTime, + const core::array< core::vector3df >& points, f32 speed, f32 tightness, + scene::ITriangleSelector* selector, f32 minYTest, f32 maxYTest, f32 yOffset) +{ + return new CSceneNodeAnimatorFollowSpline(this, startTime, points, speed, tightness, + selector, minYTest, maxYTest, yOffset); } diff -Nauwr Irrlicht/CSceneManager.h Irrlicht/CSceneManager.h --- Irrlicht/CSceneManager.h 2005-08-20 22:17:50.000000000 +0200 +++ Irrlicht/CSceneManager.h 2005-09-27 15:46:54.000000000 +0200 @@ -206,28 +233,28 @@ //! \param rotationPerSecond: Specifies the speed of the animation //! \return Returns the animator. Attach it to a scene node with ISceneNode::addAnimator() //! and the animator will animate it. - virtual ISceneNodeAnimator* createRotationAnimator(const core::vector3df& rotationPerSecond); + virtual ISceneNodeAnimatorRotation* createRotationAnimator(const core::vector3df& rotationPerSecond); //! creates a fly circle animator, which lets the attached scene node fly //! around a center. The center is the position of the scene node. //! \param rotationSpeed: //! \return Returns the animator. Attach it to a scene node with ISceneNode::addAnimator() //! and the animator will animate it. - virtual ISceneNodeAnimator* createFlyCircleAnimator(const core::vector3df& normal, f32 radius, f32 speed); + virtual ISceneNodeAnimatorFlyCircle* createFlyCircleAnimator(const core::vector3df& normal, f32 radius, f32 speed); //! Creates a fly straight animator, which lets the attached scene node //! fly or move along a line between two points. - virtual ISceneNodeAnimator* createFlyStraightAnimator(const core::vector3df& startPoint, - const core::vector3df& endPoint, u32 timeForWay, bool loop=false); + virtual ISceneNodeAnimatorFlyStraight* createFlyStraightAnimator(const core::vector3df& startPoint, + const core::vector3df& endPoint, u32 timeForWay, bool loop=false, bool animateToStartOnLoop=true); //! Creates a texture animator, which switches the textures of the target scene //! node based on a list of textures. - virtual ISceneNodeAnimator* createTextureAnimator(const core::array& textures, + virtual ISceneNodeAnimatorTexture* createTextureAnimator(const core::array& textures, s32 timePerFrame, bool loop); //! Creates a scene node animator, which deletes the scene node after //! some time automaticly. - virtual ISceneNodeAnimator* createDeleteAnimator(u32 timeMS); + virtual ISceneNodeAnimatorDelete* createDeleteAnimator(u32 timeMS); //! Creates a special scene node animator for doing automatic collision detection @@ -240,9 +267,10 @@ f32 slidingValue = 0.0005f); //! Creates a follow spline animator. - virtual ISceneNodeAnimator* createFollowSplineAnimator(s32 startTime, + virtual ISceneNodeAnimatorFollowSpline* createFollowSplineAnimator(s32 startTime, const core::array< core::vector3df >& points, - f32 speed = 1.0f, f32 tightness = 0.5f); + f32 speed = 1.0f, f32 tightness = 0.5f, scene::ITriangleSelector* selector = 0, + f32 minYTest = -1000.0f, f32 maxYTest = 1000.0f, f32 yOffset = 0.0f); //! Creates a simple ITriangleSelector, based on a mesh. virtual ITriangleSelector* createTriangleSelector(IMesh* mesh, ISceneNode* node); diff -Nauwr Irrlicht/CSceneNodeAnimatorDelete.h Irrlicht/CSceneNodeAnimatorDelete.h --- Irrlicht/CSceneNodeAnimatorDelete.h 2005-08-20 22:17:52.000000000 +0200 +++ Irrlicht/CSceneNodeAnimatorDelete.h 2005-09-27 15:54:22.000000000 +0200 @@ -5,13 +5,14 @@ #ifndef __C_SCENE_NODE_ANIMATOR_DELETE_H_INCLUDED__ #define __C_SCENE_NODE_ANIMATOR_DELETE_H_INCLUDED__ +#include "ISceneNodeAnimatorDelete.h" #include "ISceneNode.h" namespace irr { namespace scene { - class CSceneNodeAnimatorDelete : public ISceneNodeAnimator + class CSceneNodeAnimatorDelete : public ISceneNodeAnimatorDelete { public: @@ -24,6 +25,12 @@ //! animates a scene node virtual void animateNode(ISceneNode* node, u32 timeMs); + //! set the time to delete + virtual void setDeleteTime( u32 deleteTime ) { DeleteTime = deleteTime; } + + //! get the deletion time + virtual const u32& getDeleteTime() { return DeleteTime; } + private: u32 DeleteTime; diff -Naur Irrlicht/CSceneNodeAnimatorFlyCircle.cpp IrrSpintz-0.14.2/CSceneNodeAnimatorFlyCircle.cpp --- Irrlicht/CSceneNodeAnimatorFlyCircle.cpp 2006-04-07 23:27:01.770259918 +0200 +++ IrrSpintz-0.14.2/CSceneNodeAnimatorFlyCircle.cpp 2006-04-02 13:34:58.000000000 +0200 @@ -11,7 +11,7 @@ //! constructor CSceneNodeAnimatorFlyCircle::CSceneNodeAnimatorFlyCircle(u32 time, const core::vector3df& center, f32 radius, f32 speed) -: Radius(radius), Center(center), Speed(speed), StartTime(time) +: ISceneNodeAnimatorFlyCircle(0), Radius(radius), Center(center), Speed(speed), StartTime(time) { #ifdef _DEBUG setDebugName("CSceneNodeAnimatorFlyCircle"); diff -Nauwr Irrlicht/CSceneNodeAnimatorFlyCircle.h Irrlicht/CSceneNodeAnimatorFlyCircle.h --- Irrlicht/CSceneNodeAnimatorFlyCircle.h 2005-08-20 22:17:52.000000000 +0200 +++ Irrlicht/CSceneNodeAnimatorFlyCircle.h 2005-09-27 15:55:26.000000000 +0200 @@ -5,13 +5,14 @@ #ifndef __C_SCENE_NODE_ANIMATOR_FLY_CIRCLE_H_INCLUDED__ #define __C_SCENE_NODE_ANIMATOR_FLY_CIRCLE_H_INCLUDED__ +#include "ISceneNodeAnimatorFlyCircle.h" #include "ISceneNode.h" namespace irr { namespace scene { - class CSceneNodeAnimatorFlyCircle : public ISceneNodeAnimator + class CSceneNodeAnimatorFlyCircle : public ISceneNodeAnimatorFlyCircle { public: @@ -24,6 +25,24 @@ //! animates a scene node virtual void animateNode(ISceneNode* node, u32 timeMs); + //! set the radius for the circle to fly + virtual void setRadius( f32 radius ) { Radius = radius; } + + //! set the speed to fly the circle + virtual void setSpeed( f32 speed ) { Speed = speed; } + + //! set the center of the cirlce to fly + virtual void setCenter( core::vector3df center ) { Center = center; } + + //! get the radius of the circle + virtual const f32& getRadius() const { return Radius; } + + //! get the speed to fly + virtual const f32& getSpeed() const { return Speed; } + + //! get the center of the circle + virtual const core::vector3df& getCenter() const { return Center; } + private: core::vector3df Center; diff -Nauwr Irrlicht/Irrlicht/CSceneNodeAnimatorFlyStraight.cpp IrrSpintz-0.14.2/CSceneNodeAnimatorFlyStraight.cpp --- Irrlicht/Irrlicht/CSceneNodeAnimatorFlyStraight.cpp 2006-04-07 23:27:01.796256239 +0200 +++ IrrSpintz-0.14.2/CSceneNodeAnimatorFlyStraight.cpp 2006-04-02 13:34:58.000000000 +0200 @@ -3,6 +3,7 @@ // For conditions of distribution and use, see copyright notice in irrlicht.h #include "CSceneNodeAnimatorFlyStraight.h" +#include "os.h" namespace irr { @@ -13,8 +14,9 @@ //! constructor CSceneNodeAnimatorFlyStraight::CSceneNodeAnimatorFlyStraight(const core::vector3df& startPoint, const core::vector3df& endPoint, u32 timeForWay, - bool loop, u32 now) -: Start(startPoint), End(endPoint), StartTime(now), TimeForWay(timeForWay), Loop(loop) + bool loop, bool animateToStartOnLoop, u32 now) +: ISceneNodeAnimatorFlyStraight(0), Start(startPoint), End(endPoint), StartTime(now), TimeForWay(timeForWay), Loop(loop), CallbacksCalled(false) +, AnimateToStartOnLoop( animateToStartOnLoop ), Direction(1), FirstTime(true) { #ifdef _DEBUG setDebugName("CSceneNodeAnimatorFlyStraight"); @@ -44,18 +46,74 @@ if (!node) return; - u32 t = (timeMs-StartTime); + if( FirstTime ) + { + StartTime = timeMs; + LastTime = timeMs; + node->setPosition(Start); + FirstTime = false; + return; + } + + if( LastTime - StartTime >= TimeForWay ) + { + if( Loop ) + { + // In loop mode, we call the callbacks, everytime half the loop is finished, otherwise, if the + // node has been animated from the start to the end, or when it gets back to the start from the end + for( u32 i=0; isetPosition( Start ); + } + } + else + { + if( !CallbacksCalled ) + { + for( u32 i=0; isetPosition( End ); + CallbacksCalled = true; + } + } + } + else + { + u32 delta = (timeMs - LastTime); + core::vector3df pos = node->getPosition(); - if (!Loop && t >= TimeForWay) - pos = End; + if( Direction > 0 ) + { + //pos += Vector * (f32)fmod((f32)t, (f32)TimeForWay) * TimeFactor; + pos += Vector * ( delta * TimeFactor ); + } - else + else - pos += Vector * (f32)fmod((f32)t, (f32)TimeForWay) * TimeFactor; + { + //pos -= Vector * (f32)fmod((f32)t, (f32)TimeForWay) * TimeFactor; + pos -= Vector * ( delta * TimeFactor ); + } node->setPosition(pos); + LastTime = timeMs; + } } - } // end namespace scene diff -Nauwr Irrlicht/CSceneNodeAnimatorFlyStraight.h Irrlicht/CSceneNodeAnimatorFlyStraight.h --- Irrlicht/CSceneNodeAnimatorFlyStraight.h 2005-08-20 22:17:52.000000000 +0200 +++ Irrlicht/CSceneNodeAnimatorFlyStraight.h 2005-09-27 15:57:32.000000000 +0200 @@ -5,20 +5,21 @@ #ifndef __C_SCENE_NODE_ANIMATOR_FLY_STRAIGHT_H_INCLUDED__ #define __C_SCENE_NODE_ANIMATOR_FLY_STRAIGHT_H_INCLUDED__ +#include "ISceneNodeAnimatorFlyStraight.h" #include "ISceneNode.h" namespace irr { namespace scene { - class CSceneNodeAnimatorFlyStraight : public ISceneNodeAnimator + class CSceneNodeAnimatorFlyStraight : public ISceneNodeAnimatorFlyStraight { public: //! constructor CSceneNodeAnimatorFlyStraight(const core::vector3df& startPoint, - const core::vector3df& endPoint, u32 timeForWay, - bool loop, u32 now); + const core::vector3df& endPoint, u32 timeForWay, + bool loop, bool animateToStartOnLoop, u32 now); //! destructor virtual ~CSceneNodeAnimatorFlyStraight(); @@ -26,6 +27,60 @@ //! animates a scene node virtual void animateNode(ISceneNode* node, u32 timeMs); + //! set start point + virtual void setStart( core::vector3df start ) { Start = start; } + + //! set end point + virtual void setEnd( core::vector3df end ) { End = end; } + + //! set vector + virtual void setVector( core::vector3df vector ) { Vector = vector; } + + //! set waypoint length + virtual void setWayLength( f32 wayLength ) { WayLength = wayLength; } + + //! set time factor + virtual void setTimeFactor( f32 timeFactor ) { TimeFactor = timeFactor; } + + //! set starttime + virtual void setStartTime( u32 startTime ) { StartTime = startTime; } + + //! set endtime + virtual void setEndTime( u32 endTime ) { EndTime = endTime; } + + //! set time for waypoint + virtual void setTimeForWay( u32 timeForWay ) { TimeForWay = timeForWay; } + + //! set wheter or not to loop + virtual void setLoop( bool loop ) { Loop = loop; } + + //! get start point + virtual const core::vector3df& getStart() const { return Start; } + + //! get end point + virtual const core::vector3df& getEnd() const { return End; } + + //! get vector + virtual const core::vector3df& getVector() const { return Vector; } + + //! get waypoint length + virtual const f32& getWayLength() const { return WayLength; } + + //! get time factor + virtual const f32& getTimeFactor() const { return TimeFactor; } + + //! get start time + virtual const u32& getStartTime() const { return StartTime; } + + //! get end time + virtual const u32& getEndTime() const { return EndTime; } + + //! get time for each way point + virtual const u32& getTimeForWay() const { return TimeForWay; } + + //! get whether or not this animation is looping + virtual const bool& getLoop() const { return Loop; } + private: core::vector3df Start; @@ -36,7 +91,13 @@ u32 StartTime; u32 EndTime; u32 TimeForWay; + u32 LastTime; bool Loop; + bool AnimateToStartOnLoop; + bool FirstTime; + c8 Direction; + + bool CallbacksCalled; }; diff -Nauwr Irrlicht/Irrlicht/CSceneNodeAnimatorFollowSpline.cpp IrrSpintz-0.14.2/CSceneNodeAnimatorFollowSpline.cpp --- Irrlicht/Irrlicht/CSceneNodeAnimatorFollowSpline.cpp 2006-04-07 23:27:01.838250296 +0200 +++ IrrSpintz-0.14.2/CSceneNodeAnimatorFollowSpline.cpp 2006-04-02 13:34:58.000000000 +0200 @@ -3,6 +3,7 @@ // For conditions of distribution and use, see copyright notice in irrlicht.h #include "CSceneNodeAnimatorFollowSpline.h" +#include "CSceneCollisionManager.h" namespace irr { @@ -10,10 +11,11 @@ { //! constructor -CSceneNodeAnimatorFollowSpline::CSceneNodeAnimatorFollowSpline(u32 time, - const core::array< core::vector3df >& points, f32 speed, - f32 tightness) -: Points(points), Speed(speed), StartTime(time), Tightness(tightness) +CSceneNodeAnimatorFollowSpline::CSceneNodeAnimatorFollowSpline(ISceneManager* mgr, + u32 time, const core::array< core::vector3df >& points, f32 speed, f32 tightness, + scene::ITriangleSelector* selector, f32 minYTest, f32 maxYTest, f32 yOffset ) +: ISceneNodeAnimatorFollowSpline(mgr), Points(points), Speed(speed), StartTime(time), Tightness(tightness), PreviousPoint(0), +Selector(selector), MinYTest(minYTest), MaxYTest(maxYTest), YOffset(yOffset) { NumPoints = Points.size(); @@ -45,6 +47,44 @@ f32 dt = ( (timeMs-StartTime) * Speed ); s32 idx = static_cast< s32 >( 0.001f * dt ) % NumPoints; + + // determine if callback should be sent + if( PreviousPoint == 0 ) + { + if( idx != 0 ) + { + PreviousPoint = idx; + // Send waypoint callback + for( u32 i=0; igetSceneCollisionManager()->getCollisionPoint( CollisionLine, + Selector, Intersection, Triangle ) ) + { + p.Y = Intersection.Y + YOffset; + } + } + node->setPosition(p); } diff -Nauwr Irrlicht/CSceneNodeAnimatorFollowSpline.h Irrlicht/CSceneNodeAnimatorFollowSpline.h --- Irrlicht/CSceneNodeAnimatorFollowSpline.h 2005-08-20 22:17:52.000000000 +0200 +++ Irrlicht/CSceneNodeAnimatorFollowSpline.h 2005-09-27 16:16:34.000000000 +0200 @@ -5,8 +5,11 @@ #ifndef __C_SCENE_NODE_ANIMATOR_FOLLOW_SPLINE_H_INCLUDED__ #define __C_SCENE_NODE_ANIMATOR_FOLLOW_SPLINE_H_INCLUDED__ +#include "ISceneNodeAnimatorFollowSpline.h" #include "ISceneNode.h" +#include "ISceneManager.h" #include "irrArray.h" +#include "line3d.h" namespace irr { @@ -14,14 +17,15 @@ { //! Scene node animator based free code Matthias Gall wrote and sent in. (Most of //! this code is written by him, I only modified bits.) - class CSceneNodeAnimatorFollowSpline : public ISceneNodeAnimator + class CSceneNodeAnimatorFollowSpline : public ISceneNodeAnimatorFollowSpline { public: //! constructor - CSceneNodeAnimatorFollowSpline(u32 startTime, - const core::array< core::vector3df >& points, - f32 speed = 1.0f, f32 tightness = 0.5f); + CSceneNodeAnimatorFollowSpline(ISceneManager* mgr, u32 startTime, + const core::array< core::vector3df >& points, f32 speed = 1.0f, + f32 tightness = 0.5f, scene::ITriangleSelector* selector = 0, + f32 minYTest = -1000.0f, f32 maxYTest = 1000.0f, f32 yOffset = 0.0f ); //! destructor virtual ~CSceneNodeAnimatorFollowSpline(); @@ -29,6 +30,33 @@ //! animates a scene node virtual void animateNode(ISceneNode* node, u32 timeMs); + //! set a specific point in the Points list + virtual void setPoint( u32 index, core::vector3df point ) { Points[index] = point; } + + //! set a completely new point list + virtual void setPoints( core::array< core::vector3df > points ) { Points = points; NumPoints = points.size(); } + + //! set speed to traverse the points + virtual void setSpeed( f32 speed ) { Speed = speed; } + + //! set tightness + virtual void setTightness( f32 tightness ) { Tightness = tightness; } + + //! get a specific point + virtual const core::vector3df& getPoint( u32 index ) const { return Points[index]; } + + //! get the array of points + virtual const core::array< core::vector3df >& getPoints() const { return Points; } + + //! get the speed that the spline is traversed + virtual const f32& getSpeed() const { return Speed; } + + //! get the tightness + virtual const f32& getTightness() const { return Tightness; } + + //! get the number of points + virtual const u32& getNumPoints() const { return NumPoints; } + protected: //! clamps a the value idx to fit into range 0..size-1 @@ -39,6 +70,18 @@ f32 Tightness; u32 StartTime; u32 NumPoints; + + // To determine which waypoint we're at and when we change waypoints and get to end of spline + u32 PreviousPoint; + + scene::ITriangleSelector* Selector; + f32 MinYTest; + f32 MaxYTest; + f32 YOffset; + + core::line3d CollisionLine; + core::vector3d Intersection; + core::triangle3d Triangle; }; diff -Nauwr Irrlicht/Irrlicht/CSceneNodeAnimatorRotation.cpp IrrSpintz-0.14.2/CSceneNodeAnimatorRotation.cpp --- Irrlicht/Irrlicht/CSceneNodeAnimatorRotation.cpp 2006-04-07 23:27:01.864246617 +0200 +++ IrrSpintz-0.14.2/CSceneNodeAnimatorRotation.cpp 2006-04-02 13:34:58.000000000 +0200 @@ -11,7 +11,7 @@ //! constructor CSceneNodeAnimatorRotation::CSceneNodeAnimatorRotation(u32 time, const core::vector3df& rotation) -: Rotation(rotation), StartTime(time) +: ISceneNodeAnimatorRotation(0), Rotation(rotation), StartTime(time) { #ifdef _DEBUG setDebugName("CSceneNodeAnimatorRotation"); diff -Nauwr Irrlicht/CSceneNodeAnimatorRotation.h Irrlicht/CSceneNodeAnimatorRotation.h --- Irrlicht/CSceneNodeAnimatorRotation.h 2005-08-20 22:17:52.000000000 +0200 +++ Irrlicht/CSceneNodeAnimatorRotation.h 2005-09-27 16:19:58.000000000 +0200 @@ -5,13 +5,14 @@ #ifndef __C_SCENE_NODE_ANIMATOR_ROTATION_H_INCLUDED__ #define __C_SCENE_NODE_ANIMATOR_ROTATION_H_INCLUDED__ +#include "ISceneNodeAnimatorRotation.h" #include "ISceneNode.h" namespace irr { namespace scene { - class CSceneNodeAnimatorRotation : public ISceneNodeAnimator + class CSceneNodeAnimatorRotation : public ISceneNodeAnimatorRotation { public: @@ -24,6 +25,12 @@ //! animates a scene node virtual void animateNode(ISceneNode* node, u32 timeMs); + //! set rotation + virtual void setRotation( core::vector3df rotation ) { Rotation = rotation; } + + //! get rotation + virtual const core::vector3df& getRotation() const { return Rotation; } + private: core::vector3df Rotation; diff -Nauwr Irrlicht/Irrlicht/CSceneNodeAnimatorTexture.cpp IrrSpintz-0.14.2/CSceneNodeAnimatorTexture.cpp --- Irrlicht/Irrlicht/CSceneNodeAnimatorTexture.cpp 2006-04-07 23:27:01.889243080 +0200 +++ IrrSpintz-0.14.2/CSceneNodeAnimatorTexture.cpp 2006-04-02 13:34:58.000000000 +0200 @@ -13,7 +13,7 @@ //! constructor CSceneNodeAnimatorTexture::CSceneNodeAnimatorTexture(const core::array& textures, s32 timePerFrame, bool loop, u32 now) -: Loop(loop), StartTime(now), TimePerFrame(timePerFrame) +: ISceneNodeAnimatorTexture(0), Loop(loop), StartTime(now), TimePerFrame(timePerFrame) { #ifdef _DEBUG setDebugName("CSceneNodeAnimatorTexture"); diff -Nauwr Irrlicht/CSceneNodeAnimatorTexture.h Irrlicht/CSceneNodeAnimatorTexture.h --- Irrlicht/CSceneNodeAnimatorTexture.h 2005-08-20 22:17:52.000000000 +0200 +++ Irrlicht/CSceneNodeAnimatorTexture.h 2005-09-27 15:52:58.000000000 +0200 @@ -5,6 +5,7 @@ #ifndef __C_SCENE_NODE_ANIMATOR_TEXTURE_H_INCLUDED__ #define __C_SCENE_NODE_ANIMATOR_TEXTURE_H_INCLUDED__ +#include "ISceneNodeAnimatorTexture.h" #include "irrArray.h" #include "ISceneNode.h" @@ -12,7 +13,7 @@ { namespace scene { - class CSceneNodeAnimatorTexture : public ISceneNodeAnimator + class CSceneNodeAnimatorTexture : public ISceneNodeAnimatorTexture { public: @@ -26,6 +27,25 @@ //! animates a scene node virtual void animateNode(ISceneNode* node, u32 timeMs); + //! set a texture, this grabs the texture + virtual void setTexture( u32 index, video::ITexture* texture ) + { + if( Textures[index] ) + Textures[index]->drop(); + + Textures[index] = texture; + Textures[index]->grab(); + } + + //! set timer per frame + virtual void setTimePerFrame( u32 timePerFrame ) { TimePerFrame = timePerFrame; } + + //! get texture specified by index + virtual const video::ITexture* getTexture( u32 index ) { return Textures[index]; } + + //! get time per frame + virtual const u32& getTimePerFrame() const { return TimePerFrame; } + private: core::array Textures; diff -Nauwr Irrlicht/include/irrlicht.h Irrlicht/include/irrlicht.h --- Irrlicht/include/irrlicht.h 2005-08-20 22:46:48.000000000 +0200 +++ Irrlicht/include/irrlicht.h 2005-09-28 10:14:26.000000000 +0200 @@ -81,9 +81,15 @@ #include "IStringParameters.h" #include "ITriangleSelector.h" #include "ISceneNodeAnimator.h" +#include "ISceneNodeAnimatorRotation.h" +#include "ISceneNodeAnimatorFlyCircle.h" +#include "ISceneNodeAnimatorFlyStraight.h" +#include "ISceneNodeAnimatorTexture.h" +#include "ISceneNodeAnimatorCollisionResponse.h" +#include "ISceneNodeAnimatorDelete.h" +#include "ISceneNodeAnimatorFollowSpline.h" #include "ISceneCollisionManager.h" #include "IMaterialRenderer.h" -#include "ISceneNodeAnimatorCollisionResponse.h" #include "IShaderConstantSetCallBack.h" #include "IParticleSystemSceneNode.h" #include "ITerrainSceneNode.h" diff -Nauwr Irrlicht/include/ISceneManager.h Irrlicht/include/ISceneManager.h --- Irrlicht/include/ISceneManager.h 2005-08-23 18:51:58.000000000 +0200 +++ Irrlicht/include/ISceneManager.h 2005-09-27 15:46:10.000000000 +0200 @@ -150,6 +150,12 @@ class ICameraSceneNode; class IAnimatedMeshSceneNode; class ISceneNodeAnimator; + class ISceneNodeAnimatorTexture; + class ISceneNodeAnimatorDelete; + class ISceneNodeAnimatorFlyCircle; + class ISceneNodeAnimatorFlyStraight; + class ISceneNodeAnimatorFollowSpline; + class ISceneNodeAnimatorRotation; class ISceneNodeAnimatorCollisionResponse; class ILightSceneNode; class IBillboardSceneNode; @@ -779,7 +818,7 @@ and the animator will animate it. If you no longer need the animator, you should call ISceneNodeAnimator::drop(). See IUnknown::drop() for more information. */ - virtual ISceneNodeAnimator* createRotationAnimator(const core::vector3df& rotationPerSecond) = 0; + virtual ISceneNodeAnimatorRotation* createRotationAnimator(const core::vector3df& rotationPerSecond) = 0; //! Creates a fly circle animator, which lets the attached scene node fly around a center. /** \param center: Center of the circle. @@ -789,7 +828,7 @@ and the animator will animate it. If you no longer need the animator, you should call ISceneNodeAnimator::drop(). See IUnknown::drop() for more information. */ - virtual ISceneNodeAnimator* createFlyCircleAnimator(const core::vector3df& center, + virtual ISceneNodeAnimatorFlyCircle* createFlyCircleAnimator(const core::vector3df& center, f32 radius, f32 speed=0.001f) = 0; //! Creates a fly straight animator, which lets the attached scene node fly or move along a line between two points. @@ -803,7 +842,7 @@ and the animator will animate it. If you no longer need the animator, you should call ISceneNodeAnimator::drop(). See IUnknown::drop() for more information. */ - virtual ISceneNodeAnimator* createFlyStraightAnimator(const core::vector3df& startPoint, - const core::vector3df& endPoint, u32 timeForWay, bool loop=false) = 0; + virtual ISceneNodeAnimatorFlyStraight* createFlyStraightAnimator(const core::vector3df& startPoint, + const core::vector3df& endPoint, u32 timeForWay, bool loop=false, bool animateToStartOnLoop=true ) = 0; //! Creates a texture animator, which switches the textures of the target scene node based on a list of textures. @@ -816,7 +855,7 @@ and the animator will animate it. If you no longer need the animator, you should call ISceneNodeAnimator::drop(). See IUnknown::drop() for more information. */ - virtual ISceneNodeAnimator* createTextureAnimator(const core::array& textures, + virtual ISceneNodeAnimatorTexture* createTextureAnimator(const core::array& textures, s32 timePerFrame, bool loop=true) = 0; //! Creates a scene node animator, which deletes the scene node after some time automaticly. @@ -825,7 +864,7 @@ and the animator will animate it. If you no longer need the animator, you should call ISceneNodeAnimator::drop(). See IUnknown::drop() for more information. */ - virtual ISceneNodeAnimator* createDeleteAnimator(u32 timeMs) = 0; + virtual ISceneNodeAnimatorDelete* createDeleteAnimator(u32 timeMs) = 0; //! Creates a special scene node animator for doing automatic collision detection and response. /** See ISceneNodeAnimatorCollisionResponse for details. @@ -870,9 +909,10 @@ wrote: Uses a subset of hermite splines: either cardinal splines (tightness != 0.5) or catmull-rom-splines (tightness == 0.5) but this is just my understanding of this stuff, I'm not a mathematician, so this might be wrong ;) */ - virtual ISceneNodeAnimator* createFollowSplineAnimator(s32 startTime, + virtual ISceneNodeAnimatorFollowSpline* createFollowSplineAnimator(s32 startTime, const core::array< core::vector3df >& points, - f32 speed = 1.0f, f32 tightness = 0.5f) = 0; + f32 speed = 1.0f, f32 tightness = 0.5f, scene::ITriangleSelector* selector = 0, + f32 minYTest = -1000.0f, f32 maxYTest = 1000.0f, f32 yOffset = 0.0f ) = 0; //! Creates a simple ITriangleSelector, based on a mesh. /** Triangle selectors diff -Nauwr Irrlicht/Irrlicht/include/ISceneNodeAnimatorDelete.h IrrSpintz-0.14.2/include/ISceneNodeAnimatorDelete.h --- Irrlicht/Irrlicht/include/ISceneNodeAnimatorDelete.h 1970-01-01 01:00:00.000000000 +0100 +++ IrrSpintz-0.14.2/include/ISceneNodeAnimatorDelete.h 2006-04-02 13:34:58.000000000 +0200 @@ -0,0 +1,39 @@ +// Copyright (C) 2002-2006 Nikolaus Gebhardt +// This file is part of the "Irrlicht Engine". +// For conditions of distribution and use, see copyright notice in irrlicht.h + +#ifndef __I_SCENE_NODE_ANIMATOR_DELETE_H_INCLUDED__ +#define __I_SCENE_NODE_ANIMATOR_DELETE_H_INCLUDED__ + +#include "ISceneNodeAnimator.h" + +namespace irr +{ +namespace scene +{ + //! Animates a scene node. Can animate position, rotation, material, and so on. + /** A scene node animator is able to animate a scene node in a very simple way. It may + change its position, rotation, scale and/or material. There are lots of animators + to choose from. You can create scene node animators with the ISceneManager interface. + */ + class ISceneNodeAnimatorDelete : public ISceneNodeAnimator + { + public: + + ISceneNodeAnimatorDelete( ISceneManager* mgr ) + : ISceneNodeAnimator(mgr) {} + + //! destructor + virtual ~ISceneNodeAnimatorDelete() {} + + //! set the time to delete + virtual void setDeleteTime( u32 deleteTime ) = 0; + + //! get the deletion time + virtual const u32& getDeleteTime() = 0; + }; +} // end namespace scene +} // end namespace irr + +#endif // __I_SCENE_NODE_ANIMATOR_DELETE_H_INCLUDED__ + diff -Nauwr Irrlicht/Irrlicht/include/ISceneNodeAnimatorFlyCircle.h IrrSpintz-0.14.2/include/ISceneNodeAnimatorFlyCircle.h --- Irrlicht/Irrlicht/include/ISceneNodeAnimatorFlyCircle.h 1970-01-01 01:00:00.000000000 +0100 +++ IrrSpintz-0.14.2/include/ISceneNodeAnimatorFlyCircle.h 2006-04-02 13:34:58.000000000 +0200 @@ -0,0 +1,52 @@ +// Copyright (C) 2002-2006 Nikolaus Gebhardt +// This file is part of the "Irrlicht Engine". +// For conditions of distribution and use, see copyright notice in irrlicht.h + +#ifndef __I_SCENE_NODE_ANIMATOR_FLY_CIRCLE_H_INCLUDED__ +#define __I_SCENE_NODE_ANIMATOR_FLY_CIRCLE_H_INCLUDED__ + +#include "ISceneNodeAnimator.h" + +namespace irr +{ +namespace scene +{ + //! Animates a scene node. Can animate position, rotation, material, and so on. + /** A scene node animator is able to animate a scene node in a very simple way. It may + change its position, rotation, scale and/or material. There are lots of animators + to choose from. You can create scene node animators with the ISceneManager interface. + */ + class ISceneNodeAnimatorFlyCircle : public ISceneNodeAnimator + { + public: + + ISceneNodeAnimatorFlyCircle( ISceneManager* mgr ) + : ISceneNodeAnimator(mgr) {} + + //! destructor + virtual ~ISceneNodeAnimatorFlyCircle() {} + + //! set the radius for the circle to fly + virtual void setRadius( f32 radius ) = 0; + + //! set the speed to fly the circle + virtual void setSpeed( f32 speed ) = 0; + + //! set the center of the cirlce to fly + virtual void setCenter( core::vector3df center ) = 0; + + //! get the radius of the circle + virtual const f32& getRadius() const = 0; + + //! get the speed to fly + virtual const f32& getSpeed() const = 0; + + //! get the center of the circle + virtual const core::vector3df& getCenter() const = 0; + }; + +} // end namespace scene +} // end namespace irr + +#endif // __I_SCENE_NODE_ANIMATOR_FLY_CIRCLE_H_INCLUDED__ + diff -Nauwr Irrlicht/Irrlicht/include/ISceneNodeAnimatorFlyStraight.h IrrSpintz-0.14.2/include/ISceneNodeAnimatorFlyStraight.h --- Irrlicht/Irrlicht/include/ISceneNodeAnimatorFlyStraight.h 1970-01-01 01:00:00.000000000 +0100 +++ IrrSpintz-0.14.2/include/ISceneNodeAnimatorFlyStraight.h 2006-04-02 13:34:58.000000000 +0200 @@ -0,0 +1,88 @@ +// Copyright (C) 2002-2006 Nikolaus Gebhardt +// This file is part of the "Irrlicht Engine". +// For conditions of distribution and use, see copyright notice in irrlicht.h + +#ifndef __I_SCENE_NODE_ANIMATOR_FLY_STRAIGHT_H_INCLUDED__ +#define __I_SCENE_NODE_ANIMATOR_FLY_STRAIGHT_H_INCLUDED__ + +#include "ISceneNodeAnimator.h" + +namespace irr +{ +namespace scene +{ + //! Animates a scene node. Can animate position, rotation, material, and so on. + /** A scene node animator is able to animate a scene node in a very simple way. It may + change its position, rotation, scale and/or material. There are lots of animators + to choose from. You can create scene node animators with the ISceneManager interface. + */ + class ISceneNodeAnimatorFlyStraight : public ISceneNodeAnimator + { + public: + + ISceneNodeAnimatorFlyStraight( ISceneManager* mgr ) + : ISceneNodeAnimator(mgr) {} + + //! destructor + virtual ~ISceneNodeAnimatorFlyStraight() {} + + //! set start point + virtual void setStart( core::vector3df start ) = 0; + + //! set end point + virtual void setEnd( core::vector3df end ) = 0; + + //! set vector + virtual void setVector( core::vector3df vector ) = 0; + + //! set waypoint length + virtual void setWayLength( f32 wayLength ) = 0; + + //! set time factor + virtual void setTimeFactor( f32 timeFactor ) = 0; + + //! set starttime + virtual void setStartTime( u32 startTime ) = 0; + + //! set endtime + virtual void setEndTime( u32 endTime ) = 0; + + //! set time for waypoint + virtual void setTimeForWay( u32 timeForWay ) = 0; + + //! set wheter or not to loop + virtual void setLoop( bool loop ) = 0; + + //! get start point + virtual const core::vector3df& getStart() const = 0; + + //! get end point + virtual const core::vector3df& getEnd() const = 0; + + //! get vector + virtual const core::vector3df& getVector() const = 0; + + //! get waypoint length + virtual const f32& getWayLength() const = 0; + + //! get time factor + virtual const f32& getTimeFactor() const = 0; + + //! get start time + virtual const u32& getStartTime() const = 0; + + //! get end time + virtual const u32& getEndTime() const = 0; + + //! get time for each way point + virtual const u32& getTimeForWay() const = 0; + + //! get whether or not this animation is looping + virtual const bool& getLoop() const = 0; + }; + +} // end namespace scene +} // end namespace irr + +#endif // __I_SCENE_NODE_ANIMATOR_FLY_STRAIGHT_H_INCLUDED__ + diff -Nauwr Irrlicht/Irrlicht/include/ISceneNodeAnimatorFollowSpline.h IrrSpintz-0.14.2/include/ISceneNodeAnimatorFollowSpline.h --- Irrlicht/Irrlicht/include/ISceneNodeAnimatorFollowSpline.h 1970-01-01 01:00:00.000000000 +0100 +++ IrrSpintz-0.14.2/include/ISceneNodeAnimatorFollowSpline.h 2006-04-02 13:34:58.000000000 +0200 @@ -0,0 +1,62 @@ +// Copyright (C) 2002-2006 Nikolaus Gebhardt +// This file is part of the "Irrlicht Engine". +// For conditions of distribution and use, see copyright notice in irrlicht.h + +#ifndef __I_SCENE_NODE_ANIMATOR_FOLLOW_SPLINE_H_INCLUDED__ +#define __I_SCENE_NODE_ANIMATOR_FOLLOW_SPLINE_H_INCLUDED__ + +#include "ISceneNodeAnimator.h" +#include "irrArray.h" + +namespace irr +{ +namespace scene +{ + //! Animates a scene node. Can animate position, rotation, material, and so on. + /** A scene node animator is able to animate a scene node in a very simple way. It may + change its position, rotation, scale and/or material. There are lots of animators + to choose from. You can create scene node animators with the ISceneManager interface. + */ + class ISceneNodeAnimatorFollowSpline : public ISceneNodeAnimator + { + public: + + ISceneNodeAnimatorFollowSpline( ISceneManager* mgr ) + : ISceneNodeAnimator(mgr) {} + + //! destructor + virtual ~ISceneNodeAnimatorFollowSpline() {} + + //! set a specific point in the Points list + virtual void setPoint( u32 index, core::vector3df point ) = 0; + + //! set a completely new point list + virtual void setPoints( core::array< core::vector3df > points ) = 0; + + //! set speed to traverse the points + virtual void setSpeed( f32 speed ) = 0; + + //! set tightness + virtual void setTightness( f32 tightness ) = 0; + + //! get a specific point + virtual const core::vector3df& getPoint( u32 index ) const = 0; + + //! get the array of points + virtual const core::array< core::vector3df >& getPoints() const = 0; + + //! get the speed that the spline is traversed + virtual const f32& getSpeed() const = 0; + + //! get the tightness + virtual const f32& getTightness() const = 0; + + //! get the number of points + virtual const u32& getNumPoints() const = 0; + }; + +} // end namespace scene +} // end namespace irr + +#endif // __I_SCENE_NODE_ANIMATOR_FOLLOW_SPLINE_H_INCLUDED__ + diff -Nauwr Irrlicht/Irrlicht/include/ISceneNodeAnimatorRotation.h IrrSpintz-0.14.2/include/ISceneNodeAnimatorRotation.h --- Irrlicht/Irrlicht/include/ISceneNodeAnimatorRotation.h 1970-01-01 01:00:00.000000000 +0100 +++ IrrSpintz-0.14.2/include/ISceneNodeAnimatorRotation.h 2006-04-02 13:34:58.000000000 +0200 @@ -0,0 +1,40 @@ +// Copyright (C) 2002-2006 Nikolaus Gebhardt +// This file is part of the "Irrlicht Engine". +// For conditions of distribution and use, see copyright notice in irrlicht.h + +#ifndef __I_SCENE_NODE_ANIMATOR_ROTATION_H_INCLUDED__ +#define __I_SCENE_NODE_ANIMATOR_ROTATION_H_INCLUDED__ + +#include "ISceneNodeAnimator.h" + +namespace irr +{ +namespace scene +{ + //! Animates a scene node. Can animate position, rotation, material, and so on. + /** A scene node animator is able to animate a scene node in a very simple way. It may + change its position, rotation, scale and/or material. There are lots of animators + to choose from. You can create scene node animators with the ISceneManager interface. + */ + class ISceneNodeAnimatorRotation : public ISceneNodeAnimator + { + public: + + ISceneNodeAnimatorRotation( ISceneManager* mgr ) + : ISceneNodeAnimator(mgr) {} + + //! destructor + virtual ~ISceneNodeAnimatorRotation() {} + + //! set rotation + virtual void setRotation( core::vector3df rotation ) = 0; + + //! get rotation + virtual const core::vector3df& getRotation() const = 0; + }; + +} // end namespace scene +} // end namespace irr + +#endif // __I_SCENE_NODE_ANIMATOR_ROTATION_H_INCLUDED__ + diff -Nauwr Irrlicht/Irrlicht/include/ISceneNodeAnimatorTexture.h IrrSpintz-0.14.2/include/ISceneNodeAnimatorTexture.h --- Irrlicht/Irrlicht/include/ISceneNodeAnimatorTexture.h 1970-01-01 01:00:00.000000000 +0100 +++ IrrSpintz-0.14.2/include/ISceneNodeAnimatorTexture.h 2006-04-02 13:34:58.000000000 +0200 @@ -0,0 +1,48 @@ +// Copyright (C) 2002-2006 Nikolaus Gebhardt +// This file is part of the "Irrlicht Engine". +// For conditions of distribution and use, see copyright notice in irrlicht.h + +#ifndef __I_SCENE_NODE_ANIMATOR_TEXTURE_H_INCLUDED__ +#define __I_SCENE_NODE_ANIMATOR_TEXTURE_H_INCLUDED__ + +#include "ISceneNodeAnimator.h" +#include "ITexture.h" + +namespace irr +{ +namespace scene +{ + //! Animates a scene node. Can animate position, rotation, material, and so on. + /** A scene node animator is able to animate a scene node in a very simple way. It may + change its position, rotation, scale and/or material. There are lots of animators + to choose from. You can create scene node animators with the ISceneManager interface. + */ + class ISceneNodeAnimatorTexture : public ISceneNodeAnimator + { + public: + + ISceneNodeAnimatorTexture( ISceneManager* mgr ) + : ISceneNodeAnimator(mgr) {} + + //! destructor + virtual ~ISceneNodeAnimatorTexture() {} + + //! set a texture, this grabs the texture + virtual void setTexture( u32 index, video::ITexture* texture ) = 0; + + //! set timer per frame + virtual void setTimePerFrame( u32 timePerFrame ) = 0; + + //! get texture specified by index + virtual const video::ITexture* getTexture( u32 index ) = 0; + + //! get time per frame + virtual const u32& getTimePerFrame() const = 0; + + }; + +} // end namespace scene +} // end namespace irr + +#endif // __I_SCENE_NODE_ANIMATOR_TEXTURE_H_INCLUDED__ + diff -Nauwr Irrlicht/Irrlicht/CSceneNodeAnimatorDelete.cpp IrrSpintz-0.14.2/CSceneNodeAnimatorDelete.cpp --- Irrlicht/Irrlicht/CSceneNodeAnimatorDelete.cpp 2006-04-07 23:27:01.744263597 +0200 +++ IrrSpintz-0.14.2/CSceneNodeAnimatorDelete.cpp 2006-04-02 13:34:58.000000000 +0200 @@ -13,7 +13,7 @@ //! constructor CSceneNodeAnimatorDelete::CSceneNodeAnimatorDelete(ISceneManager* manager, u32 time) -: DeleteTime(time), SceneManager(manager) +: ISceneNodeAnimatorDelete(0), DeleteTime(time), SceneManager(manager) { #ifdef _DEBUG setDebugName("CSceneNodeAnimatorDelete"); @@ -28,14 +28,25 @@ } - //! animates a scene node void CSceneNodeAnimatorDelete::animateNode(ISceneNode* node, u32 timeMs) { if (timeMs > DeleteTime && node && SceneManager) - SceneManager->addToDeletionQueue(node); + { + bool addToDeleteQueue = true; + + for( u32 i=0; iaddToDeletionQueue(node); + } +} } // end namespace scene diff -Nauwr Irrlicht/Irrlicht/include/ISceneNodeAnimator.h IrrSpintz-0.14.2/include/ISceneNodeAnimator.h --- Irrlicht/Irrlicht/include/ISceneNodeAnimator.h 2006-04-07 23:27:05.834684735 +0200 +++ IrrSpintz-0.14.2/include/ISceneNodeAnimator.h 2006-04-02 13:34:58.000000000 +0200 @@ -7,6 +7,7 @@ #include "IUnknown.h" #include "vector3d.h" +#include "irrArray.h" namespace irr { @@ -13,6 +14,30 @@ namespace scene { class ISceneNode; + class ISceneManager; + + //! Enumeration for specifying which type of event was fired when a callback is called + enum EANIMATOR_EVENT + { + //! To receive any animator event + EAE_ANY, + + //! Event representing that the scene node animator is starting. + EAE_START, + + //! Event representing that the scene node animator is stoppiong. + EAE_STOP, + + //! Event representing that the scene node animator has gone through a loop + EAE_LOOP, + + //! Event representing a waypoint in the spline animator has been passed + EAE_WAYPOINT, + + EAE_COUNT + }; + + typedef bool (*SceneNodeAnimatorCallback)(ISceneNode* node, EANIMATOR_EVENT event, void* userData ); //! Animates a scene node. Can animate position, rotation, material, and so on. /** A scene node animator is able to animate a scene node in a very simple way. It may @@ -23,15 +48,42 @@ { public: + ISceneNodeAnimator( ISceneManager* mgr ) + : SceneManager(mgr) {} + //! destructor virtual ~ISceneNodeAnimator() {} - /// + /// \ /// Animates a scene node. - /// + /// \ /// \param node: Node to animate. /// \param timeMs: Current time in milli seconds. virtual void animateNode(ISceneNode* node, u32 timeMs) = 0; + + //! set callback function + virtual void setCallback( SceneNodeAnimatorCallback callback, EANIMATOR_EVENT event, void* userData = 0 ) + { + struct CallbackStruct callbackStruct; + callbackStruct.Callback = callback; + callbackStruct.Event = event; + callbackStruct.UserData = userData; + CallbackList.push_back( callbackStruct ); + } + + protected: + struct CallbackStruct + { + SceneNodeAnimatorCallback Callback; + EANIMATOR_EVENT Event; + void* UserData; + }; + + core::array< CallbackStruct > CallbackList; + + //! pointer to the scene manager + ISceneManager* SceneManager; + }; } // end namespace scene } // end namespace irr