pod.h

Go to the documentation of this file.
00001 #pragma once
00002 
00003 #include "maxheap.h"
00004 #include "Simpobj.h"
00005 #include "export.h"
00006 
00007 
00008 enum {PLACE,SIMPLE,STANDARD,INST,META,FRAG};
00009 enum { NTNM,DTNOM,TNOM,NOTM,DTM,TM};
00010 class ParticleData: public MaxHeapOperators
00011 { public:
00012      Point3 position,velocity;
00013      float size,life,age;
00014      BYTE type[2];
00015      Matrix3 *tform;
00016      Object* src;
00017 };
00018 struct Groupdata: public MaxHeapOperators
00019 { float stepSize,starttime;
00020     int count;
00021     BOOL valid;float tvalid;
00022 };
00023 
00024 class ParticleMatData: public MaxHeapOperators
00025 { public:
00026     unsigned short mtltbl;
00027     MtlID matid;
00028 };   
00029 class WithTex: public MaxHeapOperators
00030 { public:
00031      BYTE bytype;
00032    Point3 tv;
00033 };
00034 class PartwithTex:public ParticleData,public WithTex
00035 {};
00036 class PartwithMtl:public ParticleData,public ParticleMatData
00037 {};
00038 class MSpin: public MaxHeapOperators
00039 { public:
00040    float mass;
00041    Point3 spinaxis;
00042      float stretch;
00043 };
00044 class TexMatData: public WithTex,public ParticleMatData
00045 {};
00046 class ParticlePtrTab:public Tab<ParticleData *> 
00047 { public:
00048     void Clear();
00049         void Add(int c);
00050         PartwithTex *gettv(int i);
00051         PartwithMtl *getmtl(int i);
00052 };
00053 class BaseSimpleData :public ParticleData
00054 { public:
00055     float spinrate,spinphase;
00056     int table,sub;
00057 };
00058 class SimpleData :public BaseSimpleData
00059 { public:
00060     short sdtype;
00061     float dither;
00062 };
00063 class SimpleDataMat :public SimpleData,public ParticleMatData
00064 {};
00065 class SimpleDataTex :public SimpleData,public WithTex
00066 {};
00067 class SimpleDataMatTex :public SimpleDataTex,public ParticleMatData
00068 {};
00069 class StandardData :public SimpleData,public MSpin
00070 {};
00071 class StandardDataMat :public StandardData,public ParticleMatData
00072 {};
00073 class StandardDataTex :public StandardData,public WithTex
00074 {};
00075 class StandardDataMatTex :public StandardDataTex,public ParticleMatData
00076 {};
00077 class MetaPartData:public ParticleData
00078 { public:
00079     float mass,tension;
00080 };
00081 class MetaPartDataMat :public MetaPartData,public ParticleMatData
00082 {};
00083 class MetaPartDataTex :public MetaPartData,public WithTex
00084 {};
00085 class MetaPartDataMatTex :public ParticleMatData,public MetaPartDataTex
00086 {};
00087 class InstanceData:public BaseSimpleData,public MSpin
00088 { public:
00089         BYTE ofs[2];
00090     float animoffset;
00091     INode *objectptr;
00092 };
00093 class InstanceDataMat :public InstanceData,public ParticleMatData
00094 {};
00095 class InstanceDataTex :public InstanceData,public WithTex
00096 {};
00097 class InstanceDataMatTex :public InstanceDataTex,public ParticleMatData
00098 {};
00099 class FragmentData :public BaseSimpleData,public MSpin
00100 { public:
00101     FragmentData();
00102     FragmentData(BOOL nomesh);
00103     ~FragmentData();
00104   Mesh *pmesh;
00105 };
00106 class FragmentDataMat :public FragmentData,public ParticleMatData
00107 {   public:
00108     FragmentDataMat(BOOL nomesh=FALSE);
00109 };
00110 class FragmentDataTex :public FragmentData,public WithTex
00111 {   public:
00112     FragmentDataTex(BOOL nomesh=FALSE);
00113 };
00114 class FragmentDataMatTex :public FragmentDataTex,public ParticleMatData
00115 {   public:
00116     FragmentDataMatTex(BOOL nomesh=FALSE);
00117 };
00118 struct SourceInfo: public MaxHeapOperators{
00119     int refnum;
00120 };
00121 struct EffectsInfo: public MaxHeapOperators{
00122     int refnum;
00123     BOOL test;
00124     int trefnum,frefnum;
00125 };
00126 typedef Tab<INode*> InputTab;
00127 typedef Tab<SourceInfo*> SourceDataTab;
00128 typedef Tab<EffectsInfo*> EffectsDataTab;
00129 #define BASEP 1
00130 class PodObj;
00131 typedef PodObj* PodObjPtr;
00132 
00133 class PodObj : public SimpleObject2
00134 {
00135 public: 
00136     BOOL updatenow;
00137     DllExport void UpdateWrangler();
00138     DllExport void AddToList(INode *newnode,int i,BOOL add);
00139     DllExport BOOL AddSourceBinding(INode *node); 
00140     DllExport BOOL AddOperatorBinding(INode *node,BOOL test); 
00141     DllExport void AddResBinding(INode *node,int effnum,BOOL torf);
00142     DllExport void DeleteFromList(int nnum);
00143     DllExport INode *GetSource(int num);
00144     DllExport INode *GetEffects(int num);
00145     DllExport INode *GetResultT(int num);
00146     DllExport INode *GetResultF(int num);
00147     InputTab InputList;
00148     SourceDataTab Source;
00149     EffectsDataTab Effects;
00150     int podnum,groupnum;
00151     #pragma warning(push)
00152     #pragma warning(disable:4100)
00153     virtual void GetGroupStats(int gnum,Groupdata &gdata,PodObjPtr *plist) {};
00154     virtual void UpdatePod(float t=0.0f,float stepSize=-1.0f) {};
00155 
00156     using SimpleObject2::GetInterface;
00157     virtual void* GetInterface(ULONG id) { return SimpleObject2::GetInterface(id); }
00158 
00159     virtual BOOL TryBinding(INode *node) {return FALSE;}
00160     virtual void GetPart(ParticleData &part,int i){}
00161     #pragma warning(pop)
00162 };
00163 
00164 class ITestInterface: public MaxHeapOperators 
00165 {
00166     public:
00167         virtual int NPTestInterface(TimeValue t,BOOL UpdatePastCollide,ParticleData *part,float dt,INode *node,int index)=0;
00168 };
00169 
00170 class IOperatorInterface: public MaxHeapOperators 
00171 {
00172     public:
00173         virtual int NPOpInterface(TimeValue t,ParticleData *part,float dt,INode *node,int index)=0;
00174         virtual int UseOtherPod() {return -1;}
00175 };
00176