## Public API Reference

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

- File List
- File Members

# imesh/gmeshskel.h

Go to the documentation of this file.

    00001 /*
    00002     Copyright  (C) 2004 by Hristo Hristov
    00003
    00004     This library is free software; you can redistribute it and/or
    00005     modify it under the terms of the GNU Library General Public
    00006     License as published by the Free Software Foundation; either
    00007     version 2 of the License, or  (at your option) any later version.
    00008
    00009     This library is distributed in the hope that it will be useful,
    00010     but WITHOUT ANY WARRANTY; without even the implied warranty of
    00011     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    00012     Library General Public License for more details.
    00013
    00014     You should have received a copy of the GNU Library General Public
    00015     License along with this library; if not, write to the Free
    00016     Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    00017 */
    00018
    00019 #ifndef __CS_IMESH_GMESHSKEL_H__
    00020 #define __CS_IMESH_GMESHSKEL_H__
    00021
    00026 #include "csutil/scf.h"
    00027
    00028 #include "imesh/genmesh.h"
    00029
    00033 struct iRigidBody;
    00034 struct iGenMeshSkeletonBone;
    00035 struct iGenMeshSkeletonScript;
    00036 struct iGenMeshSkeletonBoneUpdateCallback;
    00037 struct iGenMeshSkeletonControlFactory;
    00038
    00039 class csReversibleTransform;
    00040 class csVector2;
    00041 class csVector3;
    00042
    00043 enum csBoneTransformMode
    00044 {
    00045   BM_SCRIPT = 0,
    00046   BM_PHYSICS,
    00047   BM_NONE
    00048 };
    00049
    00050 enum csAULevel
    00051 {
    00052   AUL_BONES = 0,
    00053   AUL_VERTICES
    00054 };
    00055
    00056 SCF_VERSION  (iGenMeshSkeletonControlState, 0, 0, 1);
    00057
    00063 struct iGenMeshSkeletonControlState : public iBase
    00064 {
    00068   virtual int GetBonesCount () = 0;
    00069
    00073   virtual iGenMeshSkeletonBone *GetBone (int i) = 0;
    00074
    00078   virtual iGenMeshSkeletonBone *FindBone (const char *name) = 0;
    00079
    00085   virtual iGenMeshSkeletonScript* Execute (const char *scriptname) = 0;
    00086
    00090   virtual size_t GetScriptsCount () = 0;
    00091
    00095   virtual iGenMeshSkeletonScript* GetScript (size_t i) = 0;
    00096
    00100   virtual iGenMeshSkeletonScript* FindScript (const char *scriptname) = 0;
    00101
    00105   virtual void StopAll () = 0;
    00106
    00110   virtual void Stop (const char* scriptname) = 0;
    00111
    00115   virtual void Stop (iGenMeshSkeletonScript *script) = 0;
    00116
    00120   virtual iGenMeshSkeletonControlFactory *GetFactory() = 0;
    00121
    00125   virtual csVector3 *GetAnimatedVertices() = 0;
    00126
    00130   virtual int GetAnimatedVerticesCount() = 0;
    00131
    00135   virtual csVector3 *GetAnimatedFaceNormals() = 0;
    00136
    00140   virtual int GetAnimatedFaceNormalsCount() = 0;
    00141
    00145   virtual csVector3 *GetAnimatedVertNormals() = 0;
    00146
    00150   virtual int GetAnimatedVertNormalsCount() = 0;
    00151 };
    00152
    00153 SCF_VERSION  (iGenMeshSkeletonControlFactory, 0, 0, 1);
    00154
    00158 struct iGenMeshSkeletonControlFactory: public iGenMeshAnimationControlFactory
    00159 {
    00163   virtual const char* LoadScriptFile(const char *filename) =0;
    00164
    00168   virtual void DeleteScript(const char *script_name) = 0;
    00169
    00173   virtual void DeleteAllScripts() = 0;
    00174 };
    00175
    00176 SCF_VERSION  (iGenMeshSkeletonBone, 0, 0, 1);
    00177
    00178 struct iGenMeshSkeletonBone : public iBase
    00179 {
    00183   virtual const char *GetName () const = 0;
    00184
    00188   virtual void SetName (const char *name) = 0;
    00189
    00193   virtual csReversibleTransform &GetTransform () = 0;
    00194
    00198   virtual void SetTransform (const csReversibleTransform &transform) = 0;
    00199
    00203   virtual csReversibleTransform &GetFullTransform () = 0;
    00204
    00208   virtual iGenMeshSkeletonBone *GetParent () = 0;
    00209
    00214   virtual void GetSkinBox (csBox3 &box, csVector3 &center) = 0;
    00215
    00223   virtual void SetMode (csBoneTransformMode mode) = 0;
    00224
    00228   virtual csBoneTransformMode GetMode () = 0;
    00229
    00233   virtual void SetRigidBody (iRigidBody *r_body,
    00234         csReversibleTransform & offset_transform) = 0;
    00235
    00239   virtual iRigidBody *GetRigidBody () = 0;
    00240
    00244   virtual int GetChildrenCount () = 0;
    00245
    00249   virtual iGenMeshSkeletonBone *GetChild (int i) = 0;
    00250
    00254   virtual iGenMeshSkeletonBone *FindChild (const char *name) = 0;
    00255
    00259   virtual void SetUpdateCallback (
    00260         iGenMeshSkeletonBoneUpdateCallback *callback) = 0;
    00261
    00265   virtual iGenMeshSkeletonBoneUpdateCallback *GetUpdateCallback () = 0;
    00266 };
    00267
    00268 SCF_VERSION  (iGenMeshSkeletonBoneUpdateCallback, 0, 0, 1);
    00269
    00273 struct iGenMeshSkeletonBoneUpdateCallback : public iBase
    00274 {
    00275   virtual void UpdateTransform(iGenMeshSkeletonBone *bone,
    00276                 const csReversibleTransform & transform) = 0;
    00277 };
    00278
    00279 SCF_VERSION  (iGenMeshSkeletonScript, 0, 0, 1);
    00280
    00284 struct iGenMeshSkeletonScript : public iBase
    00285 {
    00289   virtual const char *GetName () = 0;
    00290
    00294   virtual size_t GetTime () = 0;
    00295
    00299   virtual void SetTime (size_t time) = 0;
    00300
    00340   virtual float GetSpeed () = 0;
    00341
    00345   virtual void SetSpeed (float speed) = 0;
    00346
    00350   virtual void SetFactor (float factor) = 0;
    00351
    00355   virtual float GetFactor () = 0;
    00356 };
    00357
    00360 #endif // __CS_IMESH_GMESHSKEL_H__