Torque3D Documentation / _generateds / ShapeAnimationAsset.h

ShapeAnimationAsset.h

Engine/source/T3D/assets/ShapeAnimationAsset.h

More...

Classes:

Public Functions

DefineConsoleType(TypeShapeAnimationAssetPtr , ShapeAnimationAsset )

Detailed Description

Public Functions

DefineConsoleType(TypeShapeAnimationAssetPtr , ShapeAnimationAsset )

  1
  2//-----------------------------------------------------------------------------
  3// Copyright (c) 2013 GarageGames, LLC
  4//
  5// Permission is hereby granted, free of charge, to any person obtaining a copy
  6// of this software and associated documentation files (the "Software"), to
  7// deal in the Software without restriction, including without limitation the
  8// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  9// sell copies of the Software, and to permit persons to whom the Software is
 10// furnished to do so, subject to the following conditions:
 11//
 12// The above copyright notice and this permission notice shall be included in
 13// all copies or substantial portions of the Software.
 14//
 15// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 16// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 17// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 18// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 19// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
 21// IN THE SOFTWARE.
 22//-----------------------------------------------------------------------------
 23#ifndef SHAPE_ANIMATION_ASSET_H
 24#define SHAPE_ANIMATION_ASSET_H
 25
 26#ifndef _ASSET_BASE_H_
 27#include "assets/assetBase.h"
 28#endif
 29
 30#ifndef _ASSET_DEFINITION_H_
 31#include "assets/assetDefinition.h"
 32#endif
 33
 34#ifndef _STRINGUNIT_H_
 35#include "string/stringUnit.h"
 36#endif
 37
 38#ifndef _ASSET_FIELD_TYPES_H_
 39#include "assets/assetFieldTypes.h"
 40#endif
 41#ifndef _TSSHAPE_H_
 42#include "ts/tsShape.h"
 43#endif
 44#ifndef __RESOURCE_H__
 45#include "core/resource.h"
 46#endif
 47
 48//-----------------------------------------------------------------------------
 49class ShapeAnimationAsset : public AssetBase
 50{
 51   typedef AssetBase Parent;
 52
 53protected:
 54   StringTableEntry   mFileName;
 55   StringTableEntry   mFilePath;
 56
 57   bool            mIsEmbedded;
 58   bool            mIsCyclical;
 59
 60   bool            mIsBlend;
 61
 62   StringTableEntry mBlendAnimAssetName;
 63
 64   S32 mBlendFrame;
 65
 66   //
 67   StringTableEntry mAnimationName;
 68   S32 mStartFrame;
 69   S32 mEndFrame;
 70   bool mPadRotation;
 71   bool mPadTransforms;
 72
 73   Resource<TSShape> mSourceShape;
 74
 75public:
 76   ShapeAnimationAsset();
 77   virtual ~ShapeAnimationAsset();
 78
 79   /// Engine.
 80   static void initPersistFields();
 81   virtual void copyTo(SimObject* object);
 82
 83   void                    setAnimationFile(const char* pAnimationFile);
 84   inline StringTableEntry getAnimationFile(void) const { return mFileName; };
 85
 86   inline StringTableEntry getAnimationPath(void) const { return mFilePath; };
 87
 88   /// Declare Console Object.
 89   DECLARE_CONOBJECT(ShapeAnimationAsset);
 90
 91protected:
 92   virtual void            initializeAsset(void);
 93   virtual void            onAssetRefresh(void);
 94
 95   static bool setAnimationFile(void *obj, const char *index, const char *data) { static_cast<ShapeAnimationAsset*>(obj)->setAnimationFile(data); return false; }
 96   static const char* getAnimationFile(void* obj, const char* data) { return static_cast<ShapeAnimationAsset*>(obj)->getAnimationFile(); }
 97
 98public:
 99   StringTableEntry getAnimationFilename() { return mFileName; }
100   StringTableEntry getAnimationName() { return mAnimationName; }
101   StringTableEntry getBlendAnimationName() { return mBlendAnimAssetName; }
102
103   S32 getStartFrame() { return mStartFrame; }
104   S32 getEndFrame() { return mEndFrame; }
105
106   bool getPadRotation() { return mPadRotation; }
107   bool getPadTransforms() { return mPadTransforms; }
108
109   bool isEmbedded() { return mIsEmbedded; }
110   bool isCyclic() { return mIsCyclical; }
111   bool isBlend() { return mIsBlend; }
112
113   S32 getBlendFrame() { return mBlendFrame; }
114
115   S32 getAnimationCount();
116};
117
118DefineConsoleType(TypeShapeAnimationAssetPtr, ShapeAnimationAsset)
119
120//-----------------------------------------------------------------------------
121// TypeAssetId GuiInspectorField Class
122//-----------------------------------------------------------------------------
123/*class GuiInspectorTypeShapeAnimationAssetPtr : public GuiInspectorTypeFileName
124{
125   typedef GuiInspectorTypeFileName Parent;
126public:
127
128   GuiBitmapButtonCtrl  *mShapeEdButton;
129
130   DECLARE_CONOBJECT(GuiInspectorTypeShapeAnimationAssetPtr);
131   static void consoleInit();
132
133   virtual GuiControl* constructEditControl();
134   virtual bool updateRects();
135};*/
136
137#endif // _ASSET_BASE_H_
138
139