00001
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #pragma once
00019
00020 #include "PFExport.h"
00021 #include "IPViewManager.h"
00022 #include "..\object.h"
00023
00024
00025 #define PFSYSTEM_INTERFACE Interface_ID(0x74f93d00, 0x1eb34700)
00026 #define GetPFSystemInterface(obj) ((IPFSystem*)((GetPFObject(obj))->GetInterface(PFSYSTEM_INTERFACE)))
00027
00028
00029 class IPFSystem : public FPMixinInterface
00030 {
00031 public:
00032
00033
00034 enum { kGetMultiplier,
00035 kGetBornAllowance,
00036 kHasEmitter,
00037 kGetEmitterType,
00038 kGetEmitterDimensions,
00039 kGetEmitterGeometry,
00040 kIsEmitterGeometryAnimated,
00041 kSetRenderState,
00042 kIsRenderState,
00043 kGetIntegrationStep,
00044 kGetUpdateType,
00045 kNumParticlesSelected,
00046 kGetSelectedParticleID,
00047 kIsParticleSelected,
00048 kNumActionListsSelected,
00049 kGetSelectedActionList,
00050 kIsActionListSelected,
00051 kIsRunningScript,
00052 };
00053
00054
00055
00056 BEGIN_FUNCTION_MAP
00057
00058 FN_1(kGetMultiplier, TYPE_FLOAT, GetMultiplier, TYPE_TIMEVALUE );
00059 FN_0(kGetBornAllowance, TYPE_INT, GetBornAllowance );
00060 FN_0(kHasEmitter, TYPE_bool, HasEmitter);
00061 FN_1(kGetEmitterType, TYPE_INT, GetEmitterType, TYPE_TIMEVALUE );
00062 VFN_2(kGetEmitterDimensions, GetEmitterDimensions, TYPE_TIMEVALUE, TYPE_FLOAT_TAB_BR );
00063 FN_1(kGetEmitterGeometry, TYPE_MESH, GetEmitterGeometry, TYPE_TIMEVALUE);
00064 FN_0(kIsEmitterGeometryAnimated, TYPE_bool, IsEmitterGeometryAnimated);
00065 VFN_1(kSetRenderState, SetRenderState, TYPE_bool);
00066 FN_0(kIsRenderState, TYPE_bool, IsRenderState);
00067 FN_0(kGetIntegrationStep, TYPE_TIMEVALUE, GetIntegrationStep);
00068 FN_0(kGetUpdateType, TYPE_INT, GetUpdateType);
00069 FN_0(kNumParticlesSelected, TYPE_INT, NumParticlesSelected);
00070 FN_1(kGetSelectedParticleID, TYPE_INDEX, GetSelectedParticleID, TYPE_INDEX);
00071 FN_1(kIsParticleSelected, TYPE_bool, IsParticleSelected, TYPE_INDEX);
00072 FN_0(kNumActionListsSelected, TYPE_INT, NumActionListsSelected);
00073 FN_1(kGetSelectedActionList, TYPE_INODE, GetSelectedActionList, TYPE_INDEX);
00074 FN_1(kIsActionListSelected, TYPE_bool, IsActionListSelected, TYPE_INODE);
00075 FN_0(kIsRunningScript, TYPE_bool, IsRunningScript);
00076
00077 END_FUNCTION_MAP
00078
00079
00091 virtual float GetMultiplier(TimeValue time) = 0;
00092
00101 virtual int GetBornAllowance() = 0;
00102
00109 virtual bool HasEmitter() { return false; }
00110
00111 enum { kEmitterType_none = -1,
00112 kEmitterType_rectangle = 0,
00113 kEmitterType_circle,
00114 kEmitterType_box,
00115 kEmitterType_sphere,
00116 kEmitterType_mesh
00117 };
00118 #pragma warning(push)
00119 #pragma warning(disable:4100)
00120
00123 virtual int GetEmitterType(TimeValue time) { return kEmitterType_none; }
00124
00129 virtual void GetEmitterDimensions(TimeValue time, Tab<float>& dimensions) { }
00130
00134 virtual Mesh* GetEmitterGeometry(TimeValue time) { return NULL; }
00135
00139 virtual bool IsEmitterGeometryAnimated() { return false; }
00140
00149 virtual void SetRenderState(bool renderState=true) = 0;
00150
00154 virtual bool IsRenderState() const = 0;
00155
00161 virtual TimeValue GetIntegrationStep() const = 0;
00162
00169 enum { kPFUpdateType_complete, kPFUpdateType_forward };
00170 virtual int GetUpdateType() const { return GetPFUpdateType(); }
00171
00176 virtual int NumParticlesSelected() const { return 0; }
00177
00181 virtual int GetSelectedParticleID(int i) const { return 0; }
00182
00186 virtual bool IsParticleSelected(int id) const { return false; }
00187
00191 virtual int NumActionListsSelected() const { return 0; }
00192
00196 virtual INode* GetSelectedActionList(int i) const { return NULL; }
00197
00201 virtual bool IsActionListSelected(INode* inode) const { return false; }
00202 #pragma warning(pop)
00203
00206 virtual bool IsRunningScript() const { return false; }
00207
00211 virtual bool IsCopyClone() const { return true; }
00212
00216 virtual void ResetCopyClone() { ; }
00217
00221 FPInterfaceDesc* GetDesc() { return GetDescByID(PFSYSTEM_INTERFACE); }
00222
00225 };
00226
00227 inline IPFSystem* PFSystemInterface(Object* obj) {
00228 return ((obj == NULL) ? NULL : GetPFSystemInterface(obj));
00229 };
00230
00231 inline IPFSystem* PFSystemInterface(INode* node) {
00232 return ((node == NULL) ? NULL : PFSystemInterface(node->GetObjectRef()));
00233 };
00234