IParticleObjectExt.h

Go to the documentation of this file.
00001 /**********************************************************************
00002  *<
00003     FILE: IParticleObjectExt.h
00004 
00005     DESCRIPTION: API extension for a ParticleObject class
00006                 the interface is used by particles systems and 
00007                 particle groups. The time parameter does not
00008                 used in property access since the particle system
00009                 gives out property of the current state. You can
00010                 change the state by using UpdateParticles method
00011                 with the time specified.
00012 
00013     CREATED BY: Oleg Bayborodin
00014 
00015     HISTORY: created 10-30-01
00016 
00017  *> Copyright (c) 2001, All Rights Reserved.
00018  **********************************************************************/
00019 
00020 #pragma once
00021 
00022 #include "ifnpub.h"
00023 #include "maxtypes.h"
00024 #include "point3.h"
00025 #include "quat.h"
00026 // forward declarations
00027 class View;
00028 
00029 // interface ID
00030 #define PARTICLEOBJECTEXT_INTERFACE Interface_ID(0x66c2429a, 0x38d60a0b) 
00031 
00032 #define GetParticleObjectExtInterface(obj) ((IParticleObjectExt*)(obj)->GetInterface(PARTICLEOBJECTEXT_INTERFACE)) 
00033 #pragma warning(push)
00034 #pragma warning(disable:4100)
00035 class IParticleObjectExt : public FPMixinInterface
00036 {
00037 public:
00038 
00039     // function IDs
00040     enum {  kUpdateParticles,
00041             kSetEveryStepUpdateScriptLine,
00042             kSetEveryStepUpdateScriptFile,
00043             kSetFinalStepUpdateScriptLine,
00044             kSetFinalStepUpdateScriptFile,
00045             kExecuteEveryStepUpdateScript,
00046             kExecuteFinalStepUpdateScript,
00047             kGetUpdateTime,
00048             kGetUpdateInterval,
00049             kNumParticles,
00050             kNumParticlesGenerated,
00051             kAddParticle,
00052             kAddParticles,
00053             kDeleteParticle,
00054             kDeleteParticles,
00055             kGetParticleBornIndex,
00056             kHasParticleBornIndex,
00057             kGetParticleGroup,
00058             kGetParticleIndex,
00059             kGetCurrentParticleIndex,
00060             kGetCurrentParticleBornIndex,
00061             kSetCurrentParticleIndex,
00062             kSetCurrentParticleBornIndex,
00063             kGetParticleAgeByIndex,
00064             kGetParticleAgeByBornIndex,
00065             kSetParticleAgeByIndex,
00066             kSetParticleAgeByBornIndex,
00067             kGetParticleAge,
00068             kSetParticleAge,
00069             kGetParticleLifeSpanByIndex,
00070             kGetParticleLifeSpanByBornIndex,
00071             kSetParticleLifeSpanByIndex,
00072             kSetParticleLifeSpanByBornIndex,
00073             kGetParticleLifeSpan,
00074             kSetParticleLifeSpan,
00075             kGetParticleGroupTimeByIndex,
00076             kGetParticleGroupTimeByBornIndex,
00077             kSetParticleGroupTimeByIndex,
00078             kSetParticleGroupTimeByBornIndex,
00079             kGetParticleGroupTime,
00080             kSetParticleGroupTime,
00081             kGetParticlePositionByIndex,
00082             kGetParticlePositionByBornIndex,
00083             kSetParticlePositionByIndex,
00084             kSetParticlePositionByBornIndex,
00085             kGetParticlePosition,
00086             kSetParticlePosition,
00087             kGetParticleSpeedByIndex,
00088             kGetParticleSpeedByBornIndex,
00089             kSetParticleSpeedByIndex,
00090             kSetParticleSpeedByBornIndex,
00091             kGetParticleSpeed,
00092             kSetParticleSpeed,
00093             kGetParticleOrientationByIndex,
00094             kGetParticleOrientationByBornIndex,
00095             kSetParticleOrientationByIndex,
00096             kSetParticleOrientationByBornIndex,
00097             kGetParticleOrientation,
00098             kSetParticleOrientation,
00099             kGetParticleSpinByIndex,
00100             kGetParticleSpinByBornIndex,
00101             kSetParticleSpinByIndex,
00102             kSetParticleSpinByBornIndex,
00103             kGetParticleSpin,
00104             kSetParticleSpin,
00105             kGetParticleScaleByIndex,
00106             kGetParticleScaleByBornIndex,
00107             kSetParticleScaleByIndex,
00108             kSetParticleScaleByBornIndex,
00109             kGetParticleScale,
00110             kSetParticleScale,
00111             kGetParticleScaleXYZByIndex,
00112             kGetParticleScaleXYZByBornIndex,
00113             kSetParticleScaleXYZByIndex,
00114             kSetParticleScaleXYZByBornIndex,
00115             kGetParticleScaleXYZ,
00116             kSetParticleScaleXYZ,
00117             kGetParticleTMByIndex,
00118             kGetParticleTMByBornIndex,
00119             kSetParticleTMByIndex,
00120             kSetParticleTMByBornIndex,
00121             kGetParticleTM,
00122             kSetParticleTM,
00123             kGetParticleSelectedByIndex,
00124             kGetParticleSelectedByBornIndex,
00125             kSetParticleSelectedByIndex,
00126             kSetParticleSelectedByBornIndex,
00127             kGetParticleSelected,
00128             kSetParticleSelected,
00129             kGetParticleShapeByIndex,
00130             kGetParticleShapeByBornIndex,
00131             kSetParticleShapeByIndex,
00132             kSetParticleShapeByBornIndex,
00133             kGetParticleShape,
00134             kSetParticleShape,
00135             kSetGlobalParticleShape,
00136     }; 
00137 
00138     // Function Map for Function Publish System 
00139     //***********************************
00140 
00141     BEGIN_FUNCTION_MAP
00142 
00143     VFN_2(kUpdateParticles,                         UpdateParticles,                TYPE_INODE, TYPE_TIMEVALUE);
00144     VFN_1(kSetEveryStepUpdateScriptLine,            SetEveryStepUpdateScriptLine,   TYPE_STRING);
00145     VFN_1(kSetEveryStepUpdateScriptFile,            SetEveryStepUpdateScriptFile,   TYPE_FILENAME);
00146     VFN_1(kSetFinalStepUpdateScriptLine,            SetFinalStepUpdateScriptLine,   TYPE_STRING);
00147     VFN_1(kSetFinalStepUpdateScriptFile,            SetFinalStepUpdateScriptFile,   TYPE_FILENAME);
00148     VFN_0(kExecuteEveryStepUpdateScript,            ExecuteEveryStepUpdateScript    );
00149     VFN_0(kExecuteFinalStepUpdateScript,            ExecuteFinalStepUpdateScript    );
00150     FN_0(kGetUpdateTime,        TYPE_TIMEVALUE,     GetUpdateTime                   );
00151     VFN_2(kGetUpdateInterval,                       GetUpdateInterval,              TYPE_TIMEVALUE_BR, TYPE_TIMEVALUE_BR);
00152 
00153     RO_PROP_FN(kNumParticles,               NumParticles,           TYPE_INT);
00154     RO_PROP_FN(kNumParticlesGenerated,      NumParticlesGenerated,  TYPE_INT);
00155 
00156     FN_0(kAddParticle,          TYPE_bool,  AddParticle             );
00157     FN_1(kAddParticles,         TYPE_bool,  AddParticles,           TYPE_INT);
00158     FN_1(kDeleteParticle,       TYPE_bool,  DeleteParticle,         TYPE_INDEX);
00159     FN_2(kDeleteParticles,      TYPE_bool,  DeleteParticles,        TYPE_INDEX, TYPE_INT);
00160 
00161     FN_1(kGetParticleBornIndex, TYPE_INDEX, GetParticleBornIndex,   TYPE_INDEX);
00162     FN_2(kHasParticleBornIndex, TYPE_bool,  HasParticleBornIndex,   TYPE_INDEX, TYPE_INDEX_BR);
00163     FN_1(kGetParticleGroup,     TYPE_INODE, GetParticleGroup,       TYPE_INDEX);
00164     FN_1(kGetParticleIndex,     TYPE_INDEX, GetParticleIndex,       TYPE_INDEX);
00165 
00166     PROP_FNS(kGetCurrentParticleIndex,      GetCurrentParticleIndex,        kSetCurrentParticleIndex,       SetCurrentParticleIndex,    TYPE_INDEX);
00167     PROP_FNS(kGetCurrentParticleBornIndex,  GetCurrentParticleBornIndex,    kSetCurrentParticleBornIndex,   SetCurrentParticleBornIndex,TYPE_INDEX);
00168 
00169     FN_1(kGetParticleAgeByIndex,        TYPE_TIMEVALUE, GetParticleAgeByIndex,          TYPE_INDEX);
00170     FN_1(kGetParticleAgeByBornIndex,    TYPE_TIMEVALUE, GetParticleAgeByBornIndex,      TYPE_INDEX);
00171     VFN_2(kSetParticleAgeByIndex,                       SetParticleAgeByIndex,          TYPE_INDEX, TYPE_TIMEVALUE);
00172     VFN_2(kSetParticleAgeByBornIndex,                   SetParticleAgeByBornIndex,      TYPE_INDEX, TYPE_TIMEVALUE);
00173     PROP_FNS(kGetParticleAge, GetParticleAge, kSetParticleAge, SetParticleAge,          TYPE_TIMEVALUE);
00174 
00175     FN_1(kGetParticleLifeSpanByIndex,       TYPE_TIMEVALUE, GetParticleLifeSpanByIndex,         TYPE_INDEX);
00176     FN_1(kGetParticleLifeSpanByBornIndex,   TYPE_TIMEVALUE, GetParticleLifeSpanByBornIndex,     TYPE_INDEX);
00177     VFN_2(kSetParticleLifeSpanByIndex,                      SetParticleLifeSpanByIndex,         TYPE_INDEX, TYPE_TIMEVALUE);
00178     VFN_2(kSetParticleLifeSpanByBornIndex,                  SetParticleLifeSpanByBornIndex,     TYPE_INDEX, TYPE_TIMEVALUE);
00179     PROP_FNS(kGetParticleLifeSpan, GetParticleLifeSpan, kSetParticleLifeSpan, SetParticleLifeSpan,          TYPE_TIMEVALUE);
00180 
00181     FN_1(kGetParticleGroupTimeByIndex,      TYPE_TIMEVALUE, GetParticleGroupTimeByIndex,    TYPE_INDEX);
00182     FN_1(kGetParticleGroupTimeByBornIndex,  TYPE_TIMEVALUE, GetParticleGroupTimeByBornIndex,TYPE_INDEX);
00183     VFN_2(kSetParticleGroupTimeByIndex,                     SetParticleGroupTimeByIndex,    TYPE_INDEX, TYPE_TIMEVALUE);
00184     VFN_2(kSetParticleGroupTimeByBornIndex,                 SetParticleGroupTimeByBornIndex,TYPE_INDEX, TYPE_TIMEVALUE);
00185     PROP_FNS(kGetParticleGroupTime, GetParticleGroupTime, kSetParticleGroupTime, SetParticleGroupTime,  TYPE_TIMEVALUE);
00186 
00187     FN_1(kGetParticlePositionByIndex,       TYPE_POINT3,    GetParticlePositionByIndex,         TYPE_INDEX);
00188     FN_1(kGetParticlePositionByBornIndex,   TYPE_POINT3,    GetParticlePositionByBornIndex,     TYPE_INDEX);
00189     VFN_2(kSetParticlePositionByIndex,                      SetParticlePositionByIndex,         TYPE_INDEX, TYPE_POINT3);
00190     VFN_2(kSetParticlePositionByBornIndex,                  SetParticlePositionByBornIndex,     TYPE_INDEX, TYPE_POINT3);
00191     PROP_FNS(kGetParticlePosition, GetParticlePosition, kSetParticlePosition, SetParticlePosition,  TYPE_POINT3);
00192 
00193     FN_1(kGetParticleSpeedByIndex,      TYPE_POINT3,    GetParticleSpeedByIndex,        TYPE_INDEX);
00194     FN_1(kGetParticleSpeedByBornIndex,  TYPE_POINT3,    GetParticleSpeedByBornIndex,    TYPE_INDEX);
00195     VFN_2(kSetParticleSpeedByIndex,                     SetParticleSpeedByIndex,        TYPE_INDEX, TYPE_POINT3);
00196     VFN_2(kSetParticleSpeedByBornIndex,                 SetParticleSpeedByBornIndex,    TYPE_INDEX, TYPE_POINT3);
00197     PROP_FNS(kGetParticleSpeed, GetParticleSpeed, kSetParticleSpeed, SetParticleSpeed,  TYPE_POINT3);
00198 
00199     FN_1(kGetParticleOrientationByIndex,        TYPE_POINT3,    GetParticleOrientationByIndex,      TYPE_INDEX);
00200     FN_1(kGetParticleOrientationByBornIndex,    TYPE_POINT3,    GetParticleOrientationByBornIndex,  TYPE_INDEX);
00201     VFN_2(kSetParticleOrientationByIndex,                       SetParticleOrientationByIndex,      TYPE_INDEX, TYPE_POINT3);
00202     VFN_2(kSetParticleOrientationByBornIndex,                   SetParticleOrientationByBornIndex,  TYPE_INDEX, TYPE_POINT3);
00203     PROP_FNS(kGetParticleOrientation, GetParticleOrientation, kSetParticleOrientation, SetParticleOrientation,  TYPE_POINT3);
00204 
00205     FN_1(kGetParticleSpinByIndex,       TYPE_ANGAXIS,   GetParticleSpinByIndex,     TYPE_INDEX);
00206     FN_1(kGetParticleSpinByBornIndex,   TYPE_ANGAXIS,   GetParticleSpinByBornIndex, TYPE_INDEX);
00207     VFN_2(kSetParticleSpinByIndex,                      SetParticleSpinByIndex,     TYPE_INDEX, TYPE_ANGAXIS);
00208     VFN_2(kSetParticleSpinByBornIndex,                  SetParticleSpinByBornIndex, TYPE_INDEX, TYPE_ANGAXIS);
00209     PROP_FNS(kGetParticleSpin, GetParticleSpin, kSetParticleSpin, SetParticleSpin,  TYPE_ANGAXIS);
00210 
00211     FN_1(kGetParticleScaleByIndex,          TYPE_FLOAT, GetParticleScaleByIndex,        TYPE_INDEX);
00212     FN_1(kGetParticleScaleByBornIndex,      TYPE_FLOAT, GetParticleScaleByBornIndex,    TYPE_INDEX);
00213     VFN_2(kSetParticleScaleByIndex,                     SetParticleScaleByIndex,        TYPE_INDEX, TYPE_FLOAT);
00214     VFN_2(kSetParticleScaleByBornIndex,                 SetParticleScaleByBornIndex,    TYPE_INDEX, TYPE_FLOAT);
00215     PROP_FNS(kGetParticleScale, GetParticleScale, kSetParticleScale, SetParticleScale,  TYPE_FLOAT);
00216     FN_1(kGetParticleScaleXYZByIndex,       TYPE_POINT3,GetParticleScaleXYZByIndex,     TYPE_INDEX);
00217     FN_1(kGetParticleScaleXYZByBornIndex,   TYPE_POINT3,GetParticleScaleXYZByBornIndex, TYPE_INDEX);
00218     VFN_2(kSetParticleScaleXYZByIndex,                  SetParticleScaleXYZByIndex,     TYPE_INDEX, TYPE_POINT3);
00219     VFN_2(kSetParticleScaleXYZByBornIndex,              SetParticleScaleXYZByBornIndex, TYPE_INDEX, TYPE_POINT3);
00220     PROP_FNS(kGetParticleScaleXYZ, GetParticleScaleXYZ, kSetParticleScaleXYZ, SetParticleScaleXYZ,  TYPE_POINT3);
00221 
00222     FN_1(kGetParticleTMByIndex,         TYPE_MATRIX3,   GetParticleTMByIndex,       TYPE_INDEX);
00223     FN_1(kGetParticleTMByBornIndex,     TYPE_MATRIX3,   GetParticleTMByBornIndex,   TYPE_INDEX);
00224     VFN_2(kSetParticleTMByIndex,                        SetParticleTMByIndex,       TYPE_INDEX, TYPE_MATRIX3);
00225     VFN_2(kSetParticleTMByBornIndex,                    SetParticleTMByBornIndex,   TYPE_INDEX, TYPE_MATRIX3);
00226     PROP_FNS(kGetParticleTM, GetParticleTM, kSetParticleTM, SetParticleTM,          TYPE_MATRIX3);
00227 
00228     FN_1(kGetParticleSelectedByIndex,       TYPE_bool,  GetParticleSelectedByIndex,     TYPE_INDEX);
00229     FN_1(kGetParticleSelectedByBornIndex,   TYPE_bool,  GetParticleSelectedByBornIndex, TYPE_INDEX);
00230     VFN_2(kSetParticleSelectedByIndex,                  SetParticleSelectedByIndex,     TYPE_INDEX, TYPE_bool);
00231     VFN_2(kSetParticleSelectedByBornIndex,              SetParticleSelectedByBornIndex, TYPE_INDEX, TYPE_bool);
00232     PROP_FNS(kGetParticleSelected, GetParticleSelected, kSetParticleSelected, SetParticleSelected,  TYPE_bool);
00233 
00234     FN_1(kGetParticleShapeByIndex,      TYPE_MESH,  GetParticleShapeByIndex,        TYPE_INDEX);
00235     FN_1(kGetParticleShapeByBornIndex,  TYPE_MESH,  GetParticleShapeByBornIndex,    TYPE_INDEX);
00236     VFN_2(kSetParticleShapeByIndex,                 SetParticleShapeByIndex,        TYPE_INDEX, TYPE_MESH);
00237     VFN_2(kSetParticleShapeByBornIndex,             SetParticleShapeByBornIndex,    TYPE_INDEX, TYPE_MESH);
00238     VFN_1(kSetGlobalParticleShape,                  SetGlobalParticleShape,         TYPE_MESH);
00239     PROP_FNS(kGetParticleShape, GetParticleShape, kSetParticleShape, SetParticleShape,          TYPE_MESH);
00240 
00241     END_FUNCTION_MAP
00242 
00243     // Implemented by the Plug-In.
00244     // Since particles may have different motion, the particle system should supply speed information
00245     // on per vertex basis for a motion blur effect to be able to generate effect.
00246     // the method is not exposed in maxscript
00247     // returns true if the object supports the method
00248     // Parameters:
00249     //      TimeValue t
00250     //          The time to get the mesh vertices speed.
00251     //      INode *inode
00252     //          The node in the scene
00253     //      View& view
00254     //          If the renderer calls this method it will pass the view information here.
00255     //      Tab<Point3>& speed
00256     //          speed per vertex in world coordinates
00257     virtual bool GetRenderMeshVertexSpeed(TimeValue t, INode *inode, View& view, Tab<Point3>& speed)  { return false; }
00258 
00259     // Implemented by the Plug-In.
00260     // Particle system may supply multiple render meshes. If this method returns a positive number, 
00261     // then GetMultipleRenderMesh and GetMultipleRenderMeshTM will be called for each mesh, 
00262     // instead of calling GetRenderMesh. The method has a current time parameter which is not
00263     // the case with the NumberOfRenderMeshes method of GeomObject class
00264     // the method is not exposed in maxscript
00265     // Parameters:
00266     //      TimeValue t
00267     //          Time for the number of render meshes request.
00268     //      INode *inode
00269     //          The node in the scene
00270     //      View& view
00271     //          If the renderer calls this method it will pass the view information here.
00272     virtual int NumberOfRenderMeshes(TimeValue t, INode *inode, View& view) { return 0; }
00273     
00274     // For multiple render meshes, if it supports vertex speed for motion blur, this method must be implemented
00275     // Since particles may have different motion, the particle system should supply speed information
00276     // on per vertex basis for a motion blur effect to be able to generate effect.
00277     // the method is not exposed in maxscript
00278     // returns true if the particular render mesh supports the method
00279     // Parameters:
00280     //      TimeValue t
00281     //          The time to get the mesh vertices speed.
00282     //      INode *inode
00283     //          The node in the scene
00284     //      View& view
00285     //          If the renderer calls this method it will pass the view information here.
00286     //      int meshNumber
00287     //          Specifies which of the multiple meshes is being asked for.
00288     //      Tab<Point3>& speed
00289     //          speed per vertex in world coordinates
00290     virtual bool GetMultipleRenderMeshVertexSpeed(TimeValue t, INode *inode, View& view, int meshNumber, Tab<Point3>& speed) { return false; }
00291 
00292     // Implemented by the Plug-In.
00293     // This method is called so the particle system can update its state to reflect 
00294     // the current time passed.  This may involve generating new particle that are born, 
00295     // eliminating old particles that have expired, computing the impact of collisions or 
00296     // force field effects, and modify properties of the particles.
00297     // Parameters:
00298     //      TimeValue t
00299     //          The particles should be updated to reflect this time.
00300     //      INode *node
00301     //          This is the emitter node.
00302     // the method is not exposed in maxscript
00303     virtual void UpdateParticles(INode *node, TimeValue t) { ; }
00304 
00305     // Implemented by the Plug-in
00306     // This method defines a maxscript to be executed after every step of particle system
00307     // update integration. When a particle system updates itself from frame 0 to frame 10,
00308     // it goes through a series of integration steps: frame 1, frame 2, frame 3, ... or even
00309     // smaller steps up to the frame 10. The script will be called after each integration
00310     // step to update particle properties. Name of the file is stored by the particle system
00311     // Parameters:
00312     //      MCHAR *script
00313     //          The maxscript
00314     //      MCHAR *file
00315     //          The file name for the script file.
00316     virtual void SetEveryStepUpdateScriptLine(MCHAR* script) { ; }
00317     virtual void SetEveryStepUpdateScriptFile(MCHAR* file) { ; }
00318 
00319     // Implemented by the Plug-in
00320     // This method defines a maxscript to be executed after last step of particle system
00321     // update integration. When a particle system updates itself from frame 0 to frame 10,
00322     // it goes through a series of integration steps: frame 1, frame 2, frame 3, ... or even
00323     // smaller steps up to the frame 10. The script will be called after the last integration
00324     // step at frame 10. If you don't need to update particle properties in intermediate steps
00325     // then use this method, i.e. if you can define particle position given the current
00326     // frame without speed data.
00327     // You can use both SetUpdateScript and SetFinalUpdateScript methods at the same time.
00328     // Name of the file is stored by the particle system.
00329     // Parameters:
00330     //      MCHAR *script
00331     //          The maxscript
00332     //      MCHAR *file
00333     //          The file name for the script file.
00334     virtual void SetFinalStepUpdateScriptLine(MCHAR* script) { ; }
00335     virtual void SetFinalStepUpdateScriptFile(MCHAR* file) { ; }
00336 
00337     // Implemented by the Plug-in
00338     // This methods envokes execution of update scripts
00339     // -- for internal use only (may-21-2002)
00340     virtual void ExecuteEveryStepUpdateScript() { ; }
00341     virtual void ExecuteFinalStepUpdateScript() { ; }
00342 
00343     // Implemented by the Plug-in
00344     // Use this method to retrieve time of the current update step. The update time maybe unrelated to 
00345     // the current time of the scene.
00346     virtual TimeValue GetUpdateTime() { return 0; }
00347     // Implemented by the Plug-in
00348     // Use this method to retrieve time interval of the current update step. The update time maybe unrelated to 
00349     // the current time of the scene. The GetUpdateTime method above retrieves the finish time.
00350     virtual void GetUpdateInterval(TimeValue& start, TimeValue& finish) { ; }
00351 
00352     // Implemented by the Plug-In.
00353     // The method returns how many particles are currently in the particle system. 
00354     // Some of these particles may be dead or not born yet (indicated by GetAge(..) method =-1). 
00355     virtual int NumParticles() = 0;
00356 
00357     // Implemented by the Plug-In.
00358     // The method returns how many particles were born. Since particle systems have
00359     // a tendency of reusing indices for newly born particles, sometimes it's necessary 
00360     // to keep a track for particular particles. This method and the methods that deal with
00361     // particle IDs allow us to accomplish that.
00362     virtual int NumParticlesGenerated() { return NumParticles(); }
00363 
00364     // Implemented by the Plug-in
00365     // The following four methods modify amount of particles in the particle system
00366     // Returns true if the operation was completed successfully
00367     //      Add a single particle
00368     virtual bool AddParticle() { return false; }
00369     //      Add "num" particles into the particle system
00370     virtual bool AddParticles(int num) { return false; }
00371     //      Delete a single particle with the given index
00372     virtual bool DeleteParticle(int index) { return false; }
00373     //      List-type delete of "num" particles starting with "start"
00374     virtual bool DeleteParticles(int start, int num) { return false; }
00375 
00376     // Implemented by the Plug-In.
00377     // Each particle is given a unique ID (consecutive) upon its birth. The method 
00378     // allows us to distinguish physically different particles even if they are using 
00379     // the same particle index (because of the "index reusing").
00380     // Parameters:
00381     //      int i
00382     //          index of the particle in the range of [0, NumParticles-1]
00383     virtual int GetParticleBornIndex(int i) { return 0; }
00384 
00385     // Implemented by the Plug-In.
00386     // the methods verifies if a particle with a given particle id (born index) is present
00387     // in the particle system. The methods returns Particle Group node the particle belongs to,
00388     // and index in this group. If there is no such particle, the method returns false.
00389     // Parameters:
00390     //      int bornIndex
00391     //          particle born index
00392     //      INode*& groupNode
00393     //          particle group the particle belongs to
00394     //      int index
00395     //          particle index in the particle group or particle system
00396     virtual bool HasParticleBornIndex(int bornIndex, int& index) { return false; }
00397     virtual INode* GetParticleGroup(int index) { return NULL; }
00398     virtual int GetParticleIndex(int bornIndex) { return 0; }
00399 
00400     // Implemented by the Plug-In.
00401     // The following four methods define "current" index or bornIndex. This index is used
00402     // in the property methods below to get the property without specifying the index.
00403     virtual int GetCurrentParticleIndex() { return 0; }
00404     virtual int GetCurrentParticleBornIndex() { return 5; }
00405     virtual void SetCurrentParticleIndex(int index) { ; }
00406     virtual void SetCurrentParticleBornIndex(int bornIndex) { ; }
00407 
00408     // Implemented by the Plug-In.
00409     // The following six methods define age of the specified particle. Particle is specified by either its
00410     // index in the particle group or particle system, or by its born index
00411     // if no index is specified then the "current" index is used
00412     // Parameters:
00413     //      int id
00414     //          particle born index
00415     //      int index
00416     //          particle index in the particle group
00417     //      TimeValue age
00418     //          new age value to set for a particle
00419     virtual TimeValue GetParticleAgeByIndex(int index) { return 0; }
00420     virtual TimeValue GetParticleAgeByBornIndex(int id) { return 0; }
00421     virtual void SetParticleAgeByIndex(int index, TimeValue age) { ; }
00422     virtual void SetParticleAgeByBornIndex(int id, TimeValue age) { ; }
00423     virtual TimeValue GetParticleAge() { return 0; }
00424     virtual void SetParticleAge(TimeValue age) { ; }
00425 
00426     // Implemented by the Plug-In.
00427     // The following six methods define lifespan of the specified particle. Particle is specified by either its
00428     // index in the particle group or particle system, or by its born index
00429     // if no index is specified then the "current" index is used
00430     // Parameters:
00431     //      int id
00432     //          particle born index
00433     //      int index
00434     //          particle index in the particle group
00435     //      TimeValue lifespan
00436     //          new lifespan value to set for a particle
00437     virtual TimeValue GetParticleLifeSpanByIndex(int index) { return TIME_PosInfinity; }
00438     virtual TimeValue GetParticleLifeSpanByBornIndex(int id) { return TIME_PosInfinity; }
00439     virtual void SetParticleLifeSpanByIndex(int index, TimeValue LifeSpan) { ; }
00440     virtual void SetParticleLifeSpanByBornIndex(int id, TimeValue LifeSpan) { ; }
00441     virtual TimeValue GetParticleLifeSpan() { return TIME_PosInfinity; }
00442     virtual void SetParticleLifeSpan(TimeValue lifespan) { ; }
00443 
00444     // Implemented by the Plug-In.
00445     // The following six methods define for how long the specified particle was staying in the current
00446     // particle group. Particle is specified by either its
00447     // index in the particle group or particle system, or by its born index
00448     // if no index is specified then the "current" index is used
00449     // Parameters:
00450     //      int id
00451     //          particle born index
00452     //      int index
00453     //          particle index in the particle group
00454     //      TimeValue time
00455     //          how long particle was staying in the current particle group
00456     virtual TimeValue GetParticleGroupTimeByIndex(int index) { return 0; }
00457     virtual TimeValue GetParticleGroupTimeByBornIndex(int id) { return 0; }
00458     virtual void SetParticleGroupTimeByIndex(int index, TimeValue time) { ; }
00459     virtual void SetParticleGroupTimeByBornIndex(int id, TimeValue time) { ; }
00460     virtual TimeValue GetParticleGroupTime() { return 0; }
00461     virtual void SetParticleGroupTime(TimeValue time) { ; }
00462     
00463     // Implemented by the Plug-In.
00464     // The following six methods define position of the specified particle in the current state.
00465     // Particle is specified by either its index in the particle group or particle system, or by its born index
00466     // if no index is specified then the "current" index is used
00467     // Parameters:
00468     //      int id
00469     //          particle born index
00470     //      int index
00471     //          particle index in the particle group
00472     //      Point3 pos
00473     //          position of the particle
00474     virtual Point3* GetParticlePositionByIndex(int index) { return NULL; }
00475     virtual Point3* GetParticlePositionByBornIndex(int id) { return NULL; }
00476     virtual void SetParticlePositionByIndex(int index, Point3 pos) { ; }
00477     virtual void SetParticlePositionByBornIndex(int id, Point3 pos) { ; }
00478     virtual Point3* GetParticlePosition() { return NULL; }
00479     virtual void SetParticlePosition(Point3 pos) { ; }
00480 
00481     // Implemented by the Plug-In.
00482     // The following six methods define speed of the specified particle in the current state.
00483     // Particle is specified by either its index in the particle group or particle system, or by its born index
00484     // if no index is specified then the "current" index is used
00485     // Parameters:
00486     //      int id
00487     //          particle born index
00488     //      int index
00489     //          particle index in the particle group
00490     //      Point3 speed
00491     //          speed of the particle in units per frame
00492     virtual Point3* GetParticleSpeedByIndex(int index) { return NULL; }
00493     virtual Point3* GetParticleSpeedByBornIndex(int id) { return NULL; }
00494     virtual void SetParticleSpeedByIndex(int index, Point3 speed) { ; }
00495     virtual void SetParticleSpeedByBornIndex(int id, Point3 speed) { ; }
00496     virtual Point3* GetParticleSpeed() { return NULL; }
00497     virtual void SetParticleSpeed(Point3 speed) { ; }
00498 
00499     // Implemented by the Plug-In.
00500     // The following six methods define orientation of the specified particle in the current state.
00501     // Particle is specified by either its index in the particle group or particle system, or by its born index
00502     // if no index is specified then the "current" index is used
00503     // Parameters:
00504     //      int id
00505     //          particle born index
00506     //      int index
00507     //          particle index in the particle group
00508     //      Point3 orient
00509     //          orientation of the particle. The orientation is defined by incremental rotations
00510     //          by world axes X, Y and Z. The rotation values are in degrees.
00511     virtual Point3* GetParticleOrientationByIndex(int index) { return NULL; }
00512     virtual Point3* GetParticleOrientationByBornIndex(int id) { return NULL; }
00513     virtual void SetParticleOrientationByIndex(int index, Point3 orient) { ; }
00514     virtual void SetParticleOrientationByBornIndex(int id, Point3 orient) { ; }
00515     virtual Point3* GetParticleOrientation() { return NULL; }
00516     virtual void SetParticleOrientation(Point3 orient) { ; }
00517 
00518     // Implemented by the Plug-In.
00519     // The following six methods define angular speed of the specified particle in the current state.
00520     // Particle is specified by either its index in the particle group or particle system, or by its born index
00521     // if no index is specified then the "current" index is used
00522     // Parameters:
00523     //      int id
00524     //          particle born index
00525     //      int index
00526     //          particle index in the particle group
00527     //      AngAxis spin
00528     //          angular speed of the particle in rotation per frame
00529     //          axis defines rotation axis, angle defines rotation amount per frame
00530     virtual AngAxis* GetParticleSpinByIndex(int index) { return NULL; }
00531     virtual AngAxis* GetParticleSpinByBornIndex(int id) { return NULL; }
00532     virtual void SetParticleSpinByIndex(int index, AngAxis spin) { ; }
00533     virtual void SetParticleSpinByBornIndex(int id, AngAxis spin) { ; }
00534     virtual AngAxis* GetParticleSpin() { return NULL; }
00535     virtual void SetParticleSpin(AngAxis spin) { ; }
00536 
00537     // Implemented by the Plug-In.
00538     // The following twelve methods define scale factor of the specified particle in the current state.
00539     // The XYZ form is used for non-uniform scaling
00540     // Particle is specified by either its index in the particle group or particle system, or by its born index
00541     // if no index is specified then the "current" index is used
00542     // Parameters:
00543     //      int id
00544     //          particle born index
00545     //      int index
00546     //          particle index in the particle group
00547     //      float scale
00548     //          uniform scale factor
00549     //      Point3 scale
00550     //          scale factor for each local axis of the particle
00551     virtual float GetParticleScaleByIndex(int index) { return 1.0f; }
00552     virtual float GetParticleScaleByBornIndex(int id) { return 1.0f; }
00553     virtual void SetParticleScaleByIndex(int index, float scale) { ; }
00554     virtual void SetParticleScaleByBornIndex(int id, float scale) { ; }
00555     virtual float GetParticleScale() { return 1.0f; }
00556     virtual void SetParticleScale(float scale) { ; }
00557     virtual Point3* GetParticleScaleXYZByIndex(int index) { return NULL; }
00558     virtual Point3* GetParticleScaleXYZByBornIndex(int id) { return NULL; }
00559     virtual void SetParticleScaleXYZByIndex(int index, Point3 scale) { ; }
00560     virtual void SetParticleScaleXYZByBornIndex(int id, Point3 scale) { ; }
00561     virtual Point3* GetParticleScaleXYZ() { return NULL; }
00562     virtual void SetParticleScaleXYZ(Point3 scale) { ; }
00563 
00564     // Implemented by the Plug-In.
00565     // The following six methods define transformation matrix of the specified particle in the current state.
00566     // Particle is specified by either its index in the particle group or particle system, or by its born index
00567     // if no index is specified then the "current" index is used
00568     // Parameters:
00569     //      int id
00570     //          particle born index
00571     //      int index
00572     //          particle index in the particle group
00573     //      Matrix3 tm
00574     //          transformation matrix of the particle
00575     virtual Matrix3* GetParticleTMByIndex(int index) { return NULL; }
00576     virtual Matrix3* GetParticleTMByBornIndex(int id) { return NULL; }
00577     virtual void SetParticleTMByIndex(int index, Matrix3 tm) { ; }
00578     virtual void SetParticleTMByBornIndex(int id, Matrix3 tm) { ; }
00579     virtual Matrix3* GetParticleTM() { return NULL; }
00580     virtual void SetParticleTM(Matrix3 tm) { ; }
00581 
00582     // Implemented by the Plug-In.
00583     // The following six methods define selection status of the specified particle in the current state.
00584     // Particle is specified by either its index in the particle group or particle system, or by its born index
00585     // if no index is specified then the "current" index is used
00586     // Parameters:
00587     //      int id
00588     //          particle born index
00589     //      int index
00590     //          particle index in the particle group
00591     //      bool selected
00592     //          selection status of the particle
00593     virtual bool GetParticleSelectedByIndex(int index) { return true; }
00594     virtual bool GetParticleSelectedByBornIndex(int id) { return true; }
00595     virtual void SetParticleSelectedByIndex(int index, bool selected) { ; }
00596     virtual void SetParticleSelectedByBornIndex(int id, bool selected) { ; }
00597     virtual bool GetParticleSelected() { return true; }
00598     virtual void SetParticleSelected(bool selected) { ; }
00599 
00600 
00601     // Implemented by the Plug-In.
00602     // The following seven methods define shape of the specified particle in the current state.
00603     // Particle is specified by either its index in the particle group or particle system, or by its born index
00604     // if no index is specified then the "current" index is used
00605     // Parameters:
00606     //      int id
00607     //          particle born index
00608     //      int index
00609     //          particle index in the particle group
00610     //      Mesh* shape
00611     //          shape of the particle
00612     virtual Mesh* GetParticleShapeByIndex(int index) { return NULL; }
00613     virtual Mesh* GetParticleShapeByBornIndex(int id) { return NULL; }
00614     virtual void SetParticleShapeByIndex(int index, Mesh* shape) { ; }
00615     virtual void SetParticleShapeByBornIndex(int id, Mesh* shape) { ; }
00616     virtual Mesh* GetParticleShape() { return NULL; }
00617     virtual void SetParticleShape(Mesh* shape) { ; }
00618     // set the same shape for all particles
00619     virtual void SetGlobalParticleShape(Mesh* shape) { ; }
00620 
00621     FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLEOBJECTEXT_INTERFACE); }
00622 };
00623 
00624 #pragma warning(pop)
00625