NL3D::UAnimation Class Reference

#include <u_animation.h>

Inheritance diagram for NL3D::UAnimation:

NL3D::CAnimation

Detailed Description

Give manual access to the animation functions.

By this interface, you can load animations, get tracks from this animation with there names, and interpolate manually value from those tracks.

This interface is not made to work with UAnimationSet or UPlayList. UAnimation has its own methods to load / release animations.

Author:
Cyril 'Hulud' Corvazier

Nevrax France

Date:
2001

Definition at line 50 of file u_animation.h.

Public Member Functions

virtual bool allTrackLoop () const=0
virtual TAnimationTime getBeginTime () const=0
virtual TAnimationTime getEndTime () const=0
virtual UTrackgetTrackByName (const char *name)=0
virtual void releaseTrack (UTrack *track)=0


Member Function Documentation

virtual bool NL3D::UAnimation::allTrackLoop  )  const [pure virtual]
 

Say if all track of this animation loop. NB: If no tracks in the animation, return true

Implemented in NL3D::CAnimation.

UAnimation * NL3D::UAnimation::createAnimation const char *  sPath  )  [static]
 

Load an animation. This method will use CPath to find the good animation file. (*.anim). You should call releaseAnimation to delete the animation.

Parameters:
sPath is the animation file path.
Returns:
NULL if the file is not found. Else return the pointer on the animation interface.

Definition at line 259 of file animation.cpp.

References file, NL3D_HAUTO_UI_ANIMATION, and NL3D_MEM_ANIMATION.

00260 {
00261         NL3D_MEM_ANIMATION
00262         NL3D_HAUTO_UI_ANIMATION;
00263 
00264         // Allocate an animation
00265         std::auto_ptr<CAnimation> anim (new CAnimation);
00266 
00267         // Read it
00268         NLMISC::CIFile file;
00269         if (file.open ( NLMISC::CPath::lookup( sPath ) ) )
00270         {
00271                 // Serial the animation
00272                 file.serial (*anim);
00273 
00274                 // Return pointer
00275                 CAnimation *ret=anim.release ();
00276 
00277                 // Return the animation interface
00278                 return ret;
00279         }
00280         else 
00281                 return NULL;
00282 }

virtual TAnimationTime NL3D::UAnimation::getBeginTime  )  const [pure virtual]
 

Get begin time of the animation.

Returns:
the begin time.

Implemented in NL3D::CAnimation.

virtual TAnimationTime NL3D::UAnimation::getEndTime  )  const [pure virtual]
 

Get end time of the animation.

Returns:
the end time.

Implemented in NL3D::CAnimation.

virtual UTrack* NL3D::UAnimation::getTrackByName const char *  name  )  [pure virtual]
 

Get an animation track with its name. The track interface should be released with releaseTrack.

Parameters:
name is the name of the track to get.
Returns:
NULL if the track is not found, else a pointer on the track interface.

Implemented in NL3D::CAnimation.

void NL3D::UAnimation::releaseAnimation UAnimation animation  )  [static]
 

Release an animation. This animation must have been created will createAnimation().

Parameters:
animation is the animation to release.

Definition at line 286 of file animation.cpp.

References NL3D_HAUTO_UI_ANIMATION, and NL3D_MEM_ANIMATION.

00287 {
00288         NL3D_MEM_ANIMATION
00289         NL3D_HAUTO_UI_ANIMATION;
00290 
00291         // Cast the pointer
00292         CAnimation* release=(CAnimation*)animation;
00293 
00294         // Delete it
00295         delete release;
00296 }

virtual void NL3D::UAnimation::releaseTrack UTrack track  )  [pure virtual]
 

Relase a track interface.

Parameters:
track is a pointer on the track interface to release.

Implemented in NL3D::CAnimation.


The documentation for this class was generated from the following files:
Generated on Tue Mar 16 08:42:19 2004 for NeL by doxygen 1.3.6