#include <xsi_particlecloud.h>
This class represents a Particle Cloud in a Softimage scene.
All particle-specific functionality is exposed via the ParticleCloudPrimitive, which is accessible by calling X3DObject::GetActivePrimitive.
Normally a ParticleCloud is created with the deprecated CreateParticleCloud command. Alternatively, X3DObject::AddParticleCloud will create a basic particle cloud suitable for custom simulations driven by a custom particle operator.
using namespace XSI;
Application app ;
CValueArray args(2) ;
CValue outArg;
//Move ahead to 1 second on the timeline
args[0] = L"PlayControl.Current" ;
args[1] = 30l ;
app.ExecuteCommand( L"SetValue", args, outArg ) ;
// Create a particle cloud using CreateParticleCloud command
// This automatically creates a particle type and a particle emitter object
args[0] = app.GetActiveSceneRoot().GetRef() ; //Where to add the particle cloud
args[1] = L"grid" ; // Type of emitter object
app.ExecuteCommand( L"CreateParticleCloud", args, outArg ) ;
CValueArray & NewParticleClouds = outArg ;
ParticleCloud myCloud = NewParticleClouds[0] ;
myCloud.PutName( CString( L"CloudDemo" ) ) ;
// Particles are accessed via the Primitive
ParticleCloudPrimitive myParticlePrim = myCloud.GetActivePrimitive() ;
app.LogMessage( L"There are " +
CValue(myParticlePrim.GetCount()).GetAsText() +
L" particles" );
// Get access to the particle type associated with the cloud
CRefArray myParticleTypes = myParticlePrim.GetParticleTypes() ;
Property myParType = myParticleTypes[0] ;
app.LogMessage( L"Associated particle type " + myParType.GetFullName() ) ;
Public Member Functions |
|
| ParticleCloud () | |
| ~ParticleCloud () | |
| ParticleCloud (const CRef &in_ref) | |
| ParticleCloud (const ParticleCloud &in_obj) | |
| bool | IsA (siClassID in_ClassID) const |
| siClassID | GetClassID () const |
| ParticleCloud & | operator= (const ParticleCloud &in_obj) |
| ParticleCloud & | operator= (const CRef &in_ref) |
| ParticleCloud | ( | ) |
Default constructor.
| ~ParticleCloud | ( | ) |
Default destructor.
| ParticleCloud | ( | const CRef & | in_ref | ) |
Constructor.
| in_ref | constant reference object. |
| ParticleCloud | ( | const ParticleCloud & | in_obj | ) |
Copy constructor.
| in_obj | constant class object. |
| bool IsA | ( | siClassID | in_ClassID | ) | const [virtual] |
Returns true if a given class type is compatible with this API class.
| in_ClassID | class type. |
Reimplemented from X3DObject.
| siClassID GetClassID | ( | ) | const [virtual] |
| ParticleCloud& operator= | ( | const ParticleCloud & | in_obj | ) |
Creates an object from another object. The newly created object is set to empty if the input object is not compatible.
| in_obj | constant class object. |
| ParticleCloud& operator= | ( | const CRef & | in_ref | ) |
Creates an object from a reference object. The newly created object is set to empty if the input reference object is not compatible.
| in_ref | constant class object. |
Reimplemented from X3DObject.