This reference page is linked to from the following overview topics: Particle System Plug-ins, Plug-in Base Classes, Deformable Objects.
This is the base class for creating particle system plug-ins.
Many particle systems may be derived from class SimpleParticle instead of this class. See Class SimpleParticle for more details. Note: This class is derived from GeomObject and still has GEOMOBJECT_CLASS_ID as its super class. To determine if an object is a ParticleObject, call: Animatable::GetInterface() with the ID I_PARTICLEOBJ or use the macro: GetParticleInterface(anim) where anim is the object in question. This will return a ParticleObject* or NULL. See Class Animatable . Note: See the method Animatable::GetProperty() for details on choosing the method used to evaluate the particle system during motion blur rendering.
#include <object.h>
Public Member Functions |
|
BOOL | IsParticleSystem () |
virtual void | ApplyForceField (ForceField *ff)=0 |
This method is called to add the force field
object passed to the list of force field objects operating on this
particle system. |
|
virtual BOOL | ApplyCollisionObject (CollisionObject *co)=0 |
This method is called to add the collision
object passed to the list of collision objects operating on this
particle system. |
|
int | IsDeformable () |
Implemented by the System. |
|
BOOL | CanCacheObject () |
Implemented by the System. |
|
virtual BOOL | NormalAlignVector (TimeValue t, Point3 &pt, Point3 &norm) |
Implemented by the System. |
|
virtual Point3 | ParticlePosition (TimeValue t, int i) |
Returns the position of the specified
particle in world space at the time passed. |
|
virtual Point3 | ParticleVelocity (TimeValue t, int i) |
Returns the velocity of the specified
particle at the time passed (in 3ds Max units per tick). |
|
virtual float | ParticleSize (TimeValue t, int i) |
Returns the world space size of the
specified particle in at the time passed. |
|
virtual int | ParticleCenter (TimeValue t, int i) |
Returns a value indicating where the
particle geometry (mesh) lies in relation to the particle position.
|
|
virtual TimeValue | ParticleAge (TimeValue t, int i) |
Returns the age of the specified particle --
the length of time it has been 'alive'. |
|
virtual TimeValue | ParticleLife (TimeValue t, int i) |
Returns the life of the particle -- the
length of time the particle will be 'alive'. |
|
virtual BOOL | HasConstantTopology () |
If a particle system has a fixed number of
particles of fixed topology, then it can return TRUE for this
method, and the renderer will then compute the image motion blur
velocities based on the vertex motions, giving motion blur for
rotating particles etc. |
BOOL IsParticleSystem | ( | ) | [inline, virtual] |
virtual void ApplyForceField | ( | ForceField * | ff | ) | [pure virtual] |
This method is called to add the force field object passed to the list of force field objects operating on this particle system.
ff | Points to an instance of a ForceField object. |
void SimpleParticle::ApplyForceField(ForceField *ff) { fields.Append(1,&ff); }
Implemented in SimpleParticle.
virtual BOOL ApplyCollisionObject | ( | CollisionObject * | co | ) | [pure virtual] |
This method is called to add the collision object passed to the list of collision objects operating on this particle system.
co | Points to an instance of a collision object. |
BOOL SimpleParticle::ApplyCollisionObject(CollisionObject *co) { cobjs.Append(1,&co); return TRUE; }
Implemented in SimpleParticle.
int IsDeformable | ( | ) | [inline, virtual] |
Implemented by the System.
This method returns TRUE to indicate it is deformable. A particle object is deformable, but does not let itself be deformed using the usual GetPoint() / SetPoint() methods. Instead a space warp must apply a force field to deform the particle system.
Reimplemented from Object.
{return TRUE;}
BOOL CanCacheObject | ( | ) | [inline, virtual] |
Implemented by the System.
This method returns FALSE to indicate the object cannot be cached. Particle objects don't perform a shallow copy and therefore cannot be cached.
Reimplemented from Object.
{return FALSE;}
Implemented by the System.
This method is inherited from Class Object. This is a default implementation provided for particle systems.
t | The time to compute the normal align vector. |
pt | The point of intersection. |
norm | The normal at the point of intersection. |
Reimplemented from Object.
virtual Point3 ParticlePosition | ( | TimeValue | t, |
int | i | ||
) | [inline, virtual] |
Returns the position of the specified particle in world space at the time passed.
The Particle Age texture map and the Particle Motion Blur texture map use this method.
t | The time to return the particle position. |
i | The index of the particle. |
AColor PartAgeTex::EvalColor(ShadeContext& sc) { ... // Evaluate... Object *ob = sc.GetEvalObject(); if (ob && ob->IsParticleSystem()) { ParticleObject *obj = (ParticleObject*)ob; TimeValue t = sc.CurTime(); TimeValue age = obj->ParticleAge(t,sc.mtlNum); TimeValue life = obj->ParticleLife(t,sc.mtlNum); ...etc. } }
{return Point3(0,0,0);}
virtual Point3 ParticleVelocity | ( | TimeValue | t, |
int | i | ||
) | [inline, virtual] |
Returns the velocity of the specified particle at the time passed (in 3ds Max units per tick).
This is specified as a vector. The Particle Age texture map and the Particle Motion Blur texture map use this method.
t | The time to return the particle velocity. |
i | The index of the particle. |
{return Point3(0,0,0);}
virtual float ParticleSize | ( | TimeValue | t, |
int | i | ||
) | [inline, virtual] |
Returns the world space size of the specified particle in at the time passed.
The Particle Age texture map and the Particle Motion Blur texture map use this method.
t | The time to return the particle size. |
i | The index of the particle. |
{return 0.0f;}
virtual int ParticleCenter | ( | TimeValue | t, |
int | i | ||
) | [inline, virtual] |
Returns a value indicating where the particle geometry (mesh) lies in relation to the particle position.
This is used by Particle Motion Blur for example. It gets the point in world space of the point it is shading, the size of the particle from ParticleSize(), and the position of the mesh from ParticleCenter(). Given this information, it can know where the point is, and it makes the head and the tail more transparent.
t | The time to return the particle center. |
i | The index of the particle. |
{return PARTCENTER_CENTER;}
virtual TimeValue ParticleAge | ( | TimeValue | t, |
int | i | ||
) | [inline, virtual] |
Returns the age of the specified particle -- the length of time it has been 'alive'.
The Particle Age texture map and the Particle Motion Blur texture map use this method.
t | Specifies the time to compute the particle age. |
i | The index of the particle. |
Reimplemented in SimpleParticle.
{return -1;}
virtual TimeValue ParticleLife | ( | TimeValue | t, |
int | i | ||
) | [inline, virtual] |
Returns the life of the particle -- the length of time the particle will be 'alive'.
The Particle Age texture map and the Particle Motion Blur texture map use this method.
t | Specifies the time to compute the particle life span. |
i | The index of the particle. |
{return -1;}
virtual BOOL HasConstantTopology | ( | ) | [inline, virtual] |
If a particle system has a fixed number of particles of fixed topology, then it can return TRUE for this method, and the renderer will then compute the image motion blur velocities based on the vertex motions, giving motion blur for rotating particles etc.
If the particle system is topology-varying it should return FALSE.
{ return FALSE; }