#include <animation_set_user.h>
Inheritance diagram for NL3D::CAnimationSetUser:
Nevrax France
Definition at line 55 of file animation_set_user.h.
Public Types | |
enum | { NotFound = 0xffffffff } |
Public Member Functions | |
uint | addAnimation (const char *fileName, const char *animName) |
virtual uint | addSkeletonWeight (const char *fileName, const char *skelName) |
virtual void | build () |
CAnimationSetUser (NLMISC::IStream &f) | |
Constructor. | |
CAnimationSetUser () | |
Constructor. | |
const CAnimationSet * | getAnimationSet () const |
Animations mgt. | |
virtual UAnimation * | getAnimation (uint animationId) |
virtual uint | getAnimationIdByName (const std::string &name) const |
virtual const std::string & | getAnimationName (uint animationId) const |
virtual uint | getNumAnimation () const |
Channel mgt. | |
virtual uint | getChannelIdByName (const std::string &name) const |
SkeletonWeight mgt. | |
virtual uint | getNumSkeletonWeight () const |
virtual uint | getSkeletonWeightIdByName (const std::string &name) const |
virtual const std::string & | getSkeletonWeightName (uint skeletonId) const |
Private Attributes | |
NLMISC::CSmartPtr< CAnimationSet > | _AnimationSet |
Friends | |
class | CPlayListManagerUser |
class | CSceneUser |
|
Definition at line 56 of file u_animation_set.h.
00056 { NotFound=0xffffffff }; |
|
Constructor.
Definition at line 65 of file animation_set_user.h. References _AnimationSet, NL3D_MEM_ANIMATION_SET, nlassert, and uint.
00066 { 00067 NL3D_MEM_ANIMATION_SET 00068 00069 nlassert((uint)UAnimationSet::NotFound == (uint)CAnimationSet::NotFound ); 00070 00071 // create a smartptred animation set. 00072 _AnimationSet= new CAnimationSet; 00073 } |
|
Constructor.
Definition at line 76 of file animation_set_user.h. References _AnimationSet, NL3D_MEM_ANIMATION_SET, nlassert, and uint.
00077 { 00078 NL3D_MEM_ANIMATION_SET 00079 00080 nlassert((uint)UAnimationSet::NotFound == (uint)CAnimationSet::NotFound ); 00081 00082 // create a smartptred animation set. 00083 _AnimationSet= new CAnimationSet; 00084 00085 _AnimationSet->serial(f); 00086 } |
|
Add an animation in the animation set. After adding all your animations, call build().
Implements NL3D::UAnimationSet. Definition at line 95 of file animation_set_user.h. References _AnimationSet, file, NLMISC::CPath::lookup(), NL3D_MEM_ANIMATION_SET, and uint.
00096 { 00097 NL3D_MEM_ANIMATION_SET 00098 00099 // Allocate an animation 00100 std::auto_ptr<CAnimation> anim (new CAnimation); 00101 00102 // Read it 00103 NLMISC::CIFile file; 00104 std::string path = NLMISC::CPath::lookup (fileName, false, true); 00105 if (path.empty()) 00106 path = fileName; 00107 if ( file.open ( path ) ) 00108 { 00109 // Serial the animation 00110 file.serial (*anim); 00111 00112 // Add the animation 00113 uint id=_AnimationSet->addAnimation (animName, anim.release()); 00114 00115 // Return id 00116 return id; 00117 } 00118 else return UAnimationSet::NotFound; 00119 } |
|
Add a skeleton weight in the animation set. This method use CPath to search the skeleton file.
Implements NL3D::UAnimationSet. Definition at line 139 of file animation_set_user.h. References _AnimationSet, file, NL3D_MEM_ANIMATION_SET, and uint.
00140 { 00141 NL3D_MEM_ANIMATION_SET 00142 00143 // Allocate an animation 00144 std::auto_ptr<CSkeletonWeight> skeletonWeight (new CSkeletonWeight); 00145 00146 // Read it 00147 NLMISC::CIFile file; 00148 if (file.open ( NLMISC::CPath::lookup( fileName ) ) ) 00149 { 00150 // Serial the animation 00151 file.serial (*skeletonWeight); 00152 00153 // Add the animation 00154 uint id=_AnimationSet->addSkeletonWeight (skelName, skeletonWeight.release()); 00155 00156 // Return id 00157 return id; 00158 } 00159 else return UAnimationSet::NotFound; 00160 } |
|
Build the animation set. Call build after adding all your animations. Implements NL3D::UAnimationSet. Definition at line 124 of file animation_set_user.h. References _AnimationSet, and NL3D_MEM_ANIMATION_SET.
00125 { 00126 NL3D_MEM_ANIMATION_SET 00127 00128 _AnimationSet->build (); 00129 } |
|
Get a writable animation pointer.
Implements NL3D::UAnimationSet. Definition at line 36 of file animation_set_user.cpp. References _AnimationSet, NL3D_MEM_ANIMATION_SET, and uint.
00037 { 00038 NL3D_MEM_ANIMATION_SET 00039 00040 return _AnimationSet->getAnimation (animationId); 00041 } |
|
Get a animation ID by name. If no animation is found, method returns NotFound. Implements NL3D::UAnimationSet. Definition at line 177 of file animation_set_user.h. References _AnimationSet, NL3D_MEM_ANIMATION_SET, and uint.
00178 { 00179 NL3D_MEM_ANIMATION_SET 00180 00181 return _AnimationSet->getAnimationIdByName(name); 00182 } |
|
Get animation name. Implements NL3D::UAnimationSet. Definition at line 187 of file animation_set_user.h. References _AnimationSet, getNumAnimation(), NL3D_MEM_ANIMATION_SET, nlerror, and uint.
00188 { 00189 NL3D_MEM_ANIMATION_SET 00190 00191 if(animationId>=getNumAnimation()) 00192 nlerror("getAnimation*(): bad animation Id"); 00193 return _AnimationSet->getAnimationName(animationId); 00194 } |
|
Definition at line 45 of file animation_set_user.cpp. References _AnimationSet, and NL3D_MEM_ANIMATION_SET. Referenced by NL3D::H_AUTO_DECL().
00046 { 00047 NL3D_MEM_ANIMATION_SET 00048 00049 return _AnimationSet; 00050 } |
|
Get a channel ID with its name. If no channel is found, method returns NotFound. Implements NL3D::UAnimationSet. Definition at line 246 of file animation_set_user.h. References _AnimationSet, NL3D_MEM_ANIMATION_SET, and uint.
00247 { 00248 NL3D_MEM_ANIMATION_SET 00249 00250 return _AnimationSet->getChannelIdByName(name); 00251 } |
|
Get animations count. Implements NL3D::UAnimationSet. Definition at line 167 of file animation_set_user.h. References _AnimationSet, NL3D_MEM_ANIMATION_SET, and uint. Referenced by getAnimationName().
00168 { 00169 NL3D_MEM_ANIMATION_SET 00170 00171 return _AnimationSet->getNumAnimation(); 00172 } |
|
Get skeleton weight count. Implements NL3D::UAnimationSet. Definition at line 211 of file animation_set_user.h. References _AnimationSet, NL3D_MEM_ANIMATION_SET, and uint. Referenced by getSkeletonWeightName().
00212 { 00213 NL3D_MEM_ANIMATION_SET 00214 00215 return _AnimationSet->getNumSkeletonWeight(); 00216 } |
|
Get a SkeletonWeight ID by name. If no SkeletonWeight is found, method returns NotFound. Implements NL3D::UAnimationSet. Definition at line 221 of file animation_set_user.h. References _AnimationSet, NL3D_MEM_ANIMATION_SET, and uint.
00222 { 00223 NL3D_MEM_ANIMATION_SET 00224 00225 return _AnimationSet->getSkeletonWeightIdByName(name); 00226 } |
|
Get skeleton template name. Implements NL3D::UAnimationSet. Definition at line 231 of file animation_set_user.h. References _AnimationSet, getNumSkeletonWeight(), NL3D_MEM_ANIMATION_SET, nlerror, and uint.
00232 { 00233 NL3D_MEM_ANIMATION_SET 00234 00235 if(skeletonId>=getNumSkeletonWeight()) 00236 nlerror("getSkeletonWeight*(): bad SkeletonWeight Id"); 00237 return _AnimationSet->getSkeletonWeightName(skeletonId); 00238 } |
|
Definition at line 59 of file animation_set_user.h. |
|
Definition at line 60 of file animation_set_user.h. |
|