ParticleCloudPrimitive Class Reference
Related Scripting Object: ParticleCloudPrimitive
This class provides access to the collection of particles that make up a ParticleCloud. More...
#include <xsi_particlecloudprimitive.h>
Inheritance diagram for ParticleCloudPrimitive:
List of all members.
Detailed Description
This class provides access to the collection of particles that make up a ParticleCloud.
- See also:
- Particle, ParticleCloudPrimitive
- Example:
-
using namespace XSI;
Application app ;
CValueArray args(2) ;
CValue outArg;
args[0] = (LONG) siSphereType ;
app.ExecuteCommand( L"CreateParticleType", args, outArg ) ;
Property myParType = args[1] ;
myParType.PutName( CString(L"CustomParType") ) ;
CRefArray particleTypeArray ;
particleTypeArray.Add( myParType ) ;
ParticleCloud myParticleCloud ;
app.GetActiveSceneRoot().AddParticleCloud(
particleTypeArray,
L"CustomSimulation",
myParticleCloud ) ;
ParticleCloudPrimitive myParticlePrim = myParticleCloud.GetActivePrimitive() ;
myParticlePrim.AddParticles( 31, myParType ) ;
for ( LONG i = 0 ; i < myParticlePrim.GetCount() ; i++ )
{
Particle particle = myParticlePrim.GetParticle(i) ;
double xval = (i/3.0)-5 ;
particle.PutPosition( MATH::CVector3( xval, (0.5 * xval * xval)-6, 0 ) ) ;
}
Constructor & Destructor Documentation
Default destructor.
Constructor.
- Parameters:
-
|
|
in_ref |
constant reference object. |
Copy constructor.
- Parameters:
-
|
|
in_obj |
constant class object. |
Member Function Documentation
| bool IsA |
( |
siClassID |
in_ClassID |
) |
const [virtual] |
Returns true if a given class type is compatible with this API class.
- Parameters:
-
- Returns:
- true if the class is compatible, false otherwise.
Reimplemented from Primitive.
Returns the type of the API class.
- Returns:
- The class type.
Reimplemented from Primitive.
Creates an object from another object. The newly created object is set to empty if the input object is not compatible.
- Parameters:
-
|
|
in_obj |
constant class object. |
- Returns:
- The new ParticleCloudPrimitive object.
Creates an object from a reference object. The newly created object is set to empty if the input reference object is not compatible.
- Parameters:
-
|
|
in_ref |
constant class object. |
- Returns:
- The new ParticleCloudPrimitive object.
Reimplemented from Primitive.
| CStatus AddParticles |
( |
LONG |
in_NbParticles, |
|
|
|
const CRef & |
in_ParType |
|
|
|
) |
|
|
|
Adds particles to a cloud. This function can only be called from custom operators or on clouds with no Operator. For example, this function will fail on a cloud created with the CreateParticleCloud command unless the cloud is frozen.
- Parameters:
-
|
|
in_NbParticles |
Number of new particles to add. |
|
|
in_ParType |
Reference to an existing particle type object. |
- Note:
- The particle type should be one of the particle types initially specified in the call to X3DObject::CreateParticleCloud. If no particle type is specified then the first particle type associated with the cloud is used.
- Since:
- 4.0
Removes particles by index. This function can only be called from custom operators or on clouds with no Operator.
- Parameters:
-
|
|
in_IndexArray |
Array with the indices of the particles to remove. |
Removes particles by their IDs. This function can only be called from custom operators or on clouds with no Operator.
- Parameters:
-
|
|
in_IDArray |
Array with the particle IDs of the particles to remove. |
- See also:
- Particle::GetID
Returns the number of particles in the cloud.
| Particle GetParticle |
( |
LONG |
in_index |
) |
const |
Returns the Particle object at the specified index.
- Parameters:
-
|
|
in_index |
Index of the particle. Particles always have an index between 0 and Particle::GetCount - 1. |
Returns an array of the particle types associated with the particle cloud. A particle cloud might have particles with different types on the same cloud. An associated particle type is created automatically when the CreateParticleCloud command is called. A particle type can also be created by calling the CreateParticleType command and associated with a cloud when X3DObject::AddParticleCloud is called.
- See also:
- ParticleType
| Particle FindParticle |
( |
LONG |
in_ID |
) |
const |
Searches for a particle by its ID. Because the index of a particle may change during a simulation but its ID will not, it is sometimes convenient to lookup a particle by its ID. However finding particles by this mechanism is moderately less efficient than using Particle::GetParticle.
- Parameters:
-
- Returns:
- The particle object.
Invalid object if the requested ID was not found.
- See also:
- Particle::GetID, Particle::GetIndex
Sets the positions for all the particles in the cloud with a single API call. This approach is more efficient than calling Particle::PutPosition on every single particle.
- Parameters:
-
|
|
in_values |
Array with new X,Y,Z values for each particle, ordered as X(0), Y(0), Z(0)... X(n-1), Y(n-1), Z(n-1)
|
- See also:
- Particle::PutPosition
Returns the positions for all the particles in the cloud with a single API call. This approach is more efficient than calling Particle::GetPosition on every single particle.
- Return values:
-
|
|
out_values |
Returned array contains the X,Y,Z values for each particle, ordered as X(0), Y(0), Z(0)... X(n-1), Y(n-1), Z(n-1)
|
- See also:
- Particle::GetPosition
Sets the velocities for all the particles in the cloud with a single API call. This approach is more efficient than calling Particle::PutVelocity on every single particle.
- Parameters:
-
|
|
in_values |
Array with X,Y,Z values for each particle, ordered as X(0), Y(0), Z(0)... X(n-1), Y(n-1), Z(n-1)
|
- See also:
- Particle::PutVelocity
Returns the velocities for all the particles in the cloud with a single API call. This approach is more efficient than calling Particle::GetVelocity on every single particle.
- Return values:
-
|
|
out_values |
Returned array will contain the X,Y,Z values for each particle, ordered as X(0), Y(0), Z(0)... X(n-1), Y(n-1), Z(n-1)
|
- See also:
- Particle::GetVelocity
Sets the rotation for all the particles in the cloud with a single API call. This approach is more efficient than calling Particle::PutRotation on every single particle.
- Parameters:
-
|
|
in_values |
Array with new X,Y,Z values (in radians) for each particle, ordered as X(0), Y(0), Z(0)... X(n-1), Y(n-1), Z(n-1)
|
- See also:
- Particle::PutRotation
Returns the rotation vectors for all the particles in the cloud with a single API call. This approach is more efficient than calling Particle::GetRotation on every single particle.
- Return values:
-
|
|
out_values |
Returned array will contain the X,Y,Z values (in radians) for each particle, ordered as X(0), Y(0), Z(0)... X(n-1), Y(n-1), Z(n-1)
|
- See also:
- Particle::GetRotation
Sets the angular velocities for all the particles in the cloud with a single API call.This approach is more efficient than calling Particle::PutAngularVelocity on every single particle.
- Parameters:
-
|
|
in_values |
Array with new X,Y,Z Euler angle values (in radians) for each particle, ordered as X(0), Y(0), Z(0)... X(n-1), Y(n-1), Z(n-1)
|
- See also:
- Particle::PutAngularVelocity
Returns the angular velocities for all the particles in the cloud with a single API call. This approach is more efficient than calling Particle::GetAngularVelocity on every single particle.
- Return values:
-
|
|
out_values |
Returned array will contain the X,Y,Z Euler angles (in radians) for each particle, ordered as X(0), Y(0), Z(0)... X(n-1), Y(n-1), Z(n-1)
|
- See also:
- Particle::GetAngularVelocity
Sets the emission position in UVW coordinates for all the particles in the cloud with a single API call. This approach is more efficient than calling Particle::PutUVW on every single particle.
- Parameters:
-
|
|
in_values |
Array with new U,V,W position values for each particle, ordered as U(0), V(0), W(0)... U(n-1), V(n-1), W(n-1)
|
- See also:
- Particle::PutUVW
Returns the emission position in UVW coordinates for all the particles in the cloud with a single API call. This approach is more efficient than calling Particle::GetUVW on every single particle.
- Return values:
-
|
|
out_values |
Returned array will contain the U,V,W values for each particle, ordered as U(0), V(0), W(0)... U(n-1), V(n-1), W(n-1)
|
- See also:
- Particle::GetUVW
Sets the color of all particles in the cloud with a single API call. This approach is more efficient than calling Particle::PutColor on every single particle.
- Parameters:
-
|
|
in_values |
Array with R,G,B,A color values for each particle, ordered as R(0), G(0), B(0), A(0)... R(n-1), G(n-1), B(n-1), A(n-1)
|
- See also:
- Particle::PutColor
Returns the colors of all the particles in the cloud with a single API call. This approach is more efficient than calling Particle::GetColor on every single particle.
- Return values:
-
|
|
out_values |
Returned array will contain the R,G,B,A values for each particle, ordered as R(0), G(0), B(0), A(0)... R(n-1), G(n-1), B(n-1), A(n-1)
|
- See also:
- Particle::GetColor
Sets the size of each particle in the cloud with a single API call. This approach is more efficient than calling Particle::PutSize on every single particle.
- Parameters:
-
|
|
in_values |
Array with new size values for each particle. |
- See also:
- Particle::PutSize
Returns the size of each particle in the cloud with a single API call. This approach is more efficient than calling Particle::GetSize on every single particle.
- Return values:
-
|
|
out_values |
Returned array will contain the size of each particle |
- See also:
- Particle::GetSize
Sets the sprite angle of each particle in the cloud with a single API call. This approach is more efficient than calling Particle::PutSpriteAngle on every single particle.
- Parameters:
-
|
|
in_values |
Array with new sprite angle values for each particle. |
- See also:
- Particle::PutSpriteAngle
Returns the sprite angle for all the particles in the cloud with a single API call. This approach is more efficient than calling Particle::GetSpriteAngle on every single particle.
- Return values:
-
|
|
out_values |
Returned array will contain the sprite angle of each particle |
- See also:
- Particle::GetSpriteAngle
Sets the mass of each particle in the cloud with a single API call. This approach is more efficient than calling Particle::PutMass on every single particle.
- Parameters:
-
|
|
in_values |
Array with new mass values for each particle. |
- See also:
- Particle::PutMass
Returns the mass of each particle in the cloud with a single API call. This approach is more efficient than calling Particle::GetMass on every single particle.
- Return values:
-
|
|
out_values |
Returned array will contain the mass of each particle |
- See also:
- Particle::GetMass
Returns the density of each particle in the cloud with a single API call. This approach is more efficient than calling Particle::GetDensity on every single particle.
- Return values:
-
|
|
out_values |
Returned array will contain the density of each particle |
- See also:
- Particle::GetDensity
Returns the pressure on each particle in the cloud with a single API call. This approach is more efficient than calling Particle::GetPressure on every single particle.
- Return values:
-
|
|
out_values |
Returned array will contain the pressure of each particle |
- See also:
- Particle::GetPressure
Returns the length of the path travelled by each particles in the cloud with a single API call. This approach is more efficient than calling Particle::GetPathLength on every single particle.
- Return values:
-
|
|
out_values |
Returned array will contain the path length of each particle |
- See also:
- Particle::GetPathLength
Sets the age of each particle in the cloud with a single API call. This approach is more efficient than calling Particle::PutAge on every single particle.
- Parameters:
-
|
|
in_values |
Array with new age values for each particle. |
- See also:
- Particle::PutAge
Returns the age of each particle in the cloud with a single API call. This approach is more efficient than calling Particle::GetAge on every single particle.
- Return values:
-
|
|
out_values |
Returned array will contain the age of each particle |
- See also:
- Particle::GetAge
Sets the random number generation seed of each particle in the cloud with a single API call. This approach is more efficient than calling Particle::PutSeed on every single particle.
- Parameters:
-
|
|
in_values |
Array with new seed values for each particle. |
- See also:
- Particle::PutSeed
Returns the random number generation seed of each particle in the cloud with a single API call. This approach is more efficient than calling Particle::GetSeed on every single particle.
- Return values:
-
|
|
out_values |
Returned array will contain the seed of each particle |
- See also:
- Particle::GetSeed
Sets the life span of each particle in the cloud with a single API call. This approach is more efficient than calling Particle::PutAgeLimit on every single particle.
- Parameters:
-
|
|
in_values |
Array with new age limit values for each particle. |
- See also:
- Particle::PutAgeLimit
Returns the life span of each particle in the cloud with a single API call. This approach is more efficient than calling Particle::GetAgeLimit on every single particle.
- Return values:
-
|
|
out_values |
Returned array will contain the age limit of each particle |
- See also:
- Particle::GetAgeLimit
Sets the sprite index of each particle in the cloud with a single API call. This approach is more efficient than calling Particle::PutSpriteIndex on every single particle.
- Parameters:
-
|
|
in_values |
Array with new sprite index values for each particle. |
- See also:
- Particle::PutSpriteIndex
Returns the sprite index of each particle in the cloud with a single API call. This approach is more efficient than calling Particle::GetSpriteIndex on every single particle.
- Return values:
-
|
|
out_values |
Returned array will contain the sprite index of each particle |
- See also:
- Particle::GetSpriteIndex
Sets the particle type ID of each particle in the cloud with a single API call. This approach is more efficient than calling Particle::PutTypeID on every single particle.
- Parameters:
-
|
|
in_values |
Array with new particle type IDs for each particle. |
- See also:
- Particle::PutTypeID
Returns the particle type ID of each particle in the cloud with a single API call. This approach is more efficient than calling Particle::GetTypeID on every single particle.
- Return values:
-
|
|
out_values |
Returned array will contain the type ID of each particle |
- See also:
- Particle::GetTypeID
Returns the ID of each particle in the cloud with a single API call. This approach is more efficient than calling Particle::GetID on every single particle.
- Parameters:
-
|
|
in_values |
Returned array will contain the ID of each particle |
- See also:
- Particle::GetID
The documentation for this class was generated from the following file: