- Main Page
- Modules
- Namespaces
- Classes
- Files
- Related Pages

- File List
- File Members

# FCDocument/FCDAnimationClip.h

Go to the documentation of this file.

    00001 /*
    00002     Copyright (C) 2005-2007 Feeling Software Inc.
    00003     Portions of the code are:
    00004     Copyright (C) 2005-2007 Sony Computer Entertainment America
    00005
    00006     MIT License: http://www.opensource.org/licenses/mit-license.php
    00007 */
    00008
    00014 #ifndef _FCD_ANIMATION_CLIP_H_
    00015 #define _FCD_ANIMATION_CLIP_H_
    00016
    00017 class FCDocument;
    00018 class FCDAnimation;
    00019 class FCDAnimationCurve;
    00020
    00021 class FCDEntityInstance;
    00022
    00023 typedef FUTrackedList<FCDAnimationCurve> FCDAnimationCurveTrackList;
    00025 #ifndef _FCD_ENTITY_H_
    00026 #include "FCDocument/FCDEntity.h"
    00027 #endif // _FCD_ENTITY_H_
    00028
    00029 #ifndef _FCD_ENTITY_INSTANCE_H_
    00030 #include "FCDocument/FCDEntityInstance.h"
    00031 #endif // _FCD_ENTITY__INSTANCE_H_
    00032
    00042 class FCOLLADA_EXPORT FCDAnimationClip : public FCDEntity
    00043 {
    00044 private:
    00045     DeclareObjectType(FCDEntity);
    00046     FCDAnimationCurveTrackList curves;
    00047
    00048     DeclareParameter(float, FUParameterQualifiers::SIMPLE, start, FC("Start Time"));
    00049     DeclareParameter(float, FUParameterQualifiers::SIMPLE, end, FC("End Time"));
    00050     DeclareParameterContainer(FCDEntityInstance, animations, FC("Animation Instances"));
    00051     StringList names; // names are supported on animation_instances
    00052
    00053 public:
    00056     FCDAnimationClip(FCDocument* document);
    00057
    00059     virtual ~FCDAnimationClip();
    00060
    00067     virtual FCDEntity* Clone(FCDEntity* clone = NULL, bool cloneChildren = false) const;
    00068
    00072     virtual Type GetType() const { return ANIMATION_CLIP; }
    00073
    00076     FCDAnimationCurveTrackList& GetClipCurves() { return curves; }
    00077     const FCDAnimationCurveTrackList& GetClipCurves() const { return curves; }
    00081     void AddClipCurve(FCDAnimationCurve* curve);
    00082
    00087     float GetStart() const { return start; }
    00088
    00091     void SetStart(float _start) { start = _start; SetDirtyFlag(); }
    00092
    00097     float GetEnd() const { return end; }
    00098
    00101     void SetEnd(float _end) { end = _end; SetDirtyFlag(); }
    00102
    00105     inline size_t GetAnimationCount() const { return animations.size(); }
    00106
    00110     inline FCDAnimation* GetAnimation(size_t index) const { FUAssert(GetAnimationCount() > index, return NULL); return (FCDAnimation*) animations[index]->GetEntity(); };
    00111
    00115     inline void SetAnimationName(const fm::string& name, size_t index) { if (names.size() <= index) names.resize(index + 1); names[index] = name; }
    00116
    00120     inline fm::string GetAnimationName(size_t index) const { return names[index]; }
    00121
    00124     FCDEntityInstance* AddInstanceAnimation();
    00125
    00129     FCDEntityInstance* AddInstanceAnimation(FCDAnimation* animation);
    00130 };
    00131
    00132 #endif // _FCD_ANIMATION_CLIP_H_
    00133