Main Page | Modules | Namespace List | Class Hierarchy | Class List | Directories | File List | Class Members | File Members

Skeleton.cpp

Go to the documentation of this file.
00001 #include "Skeleton.h"
00002 
00003 using namespace model;
00004 
00022 Skeleton::Skeleton(const Skeleton& other) {
00023         m_vBones = other.m_vBones;
00024 }  
00025 
00046 Skeleton& Skeleton::operator=(const Skeleton& other)
00047 {
00048         // if same object
00049         if ( this == &other )
00050                 return *this;
00051 
00052         m_vBones = other.m_vBones;
00053 
00054         return *this;
00055 }  
00056 
00077 bool Skeleton::operator==( const Skeleton& other ) const
00078 {
00079         if(m_vBones == other.m_vBones) {
00080                 return true;
00081         }
00082         return false;  
00083 }   
00084 
00105 bool Skeleton::operator!=( const Skeleton& other ) const
00106 {
00107         if(m_vBones != other.m_vBones) {
00108                 return false;
00109         }
00110         return true;
00111 }  
00112 
00130 vector<Bone*> Skeleton::getBones() {
00131         return m_vBones;
00132 }
00133 
00154 Bone* Skeleton::getBone(string name) {
00155         for(int i=0; i<m_vBones.size(); i++) {
00156                 if(name.compare(m_vBones[i]->getName()) == 0) {
00157                         return m_vBones[i];
00158                 }
00159         }
00160         return NULL;
00161 }
00162 
00183 Bone* Skeleton::getBone(int id) {
00184         return m_vBones[id];
00185 }
00186 
00205 void Skeleton::addBone(Bone* parent, IvVector3* direction, float length, string name) {
00206         Bone* bone = new Bone(parent,direction,length,name);
00207         parent->addChild(bone);
00208         m_vBones.push_back(bone);
00209 }
00210 
00228 void Skeleton::removeBone(int id) {
00229 
00230 }
00231 
00249 void Skeleton::removeBone(std::string name) {
00250 
00251 }
00252 

Generated on Tue Apr 17 09:39:12 2007 for PCG Library by  doxygen 1.3.9.1