Creating and Applying an Obstacle to a Particle Cloud

1. Start by getting a pointer to the particle cloud.

    CreateParticleCloud( "", "Grid" );
    var pcloud = ActiveSceneRoot.FindChild( "", siCloudPrimType );

2. Add a 3d scene object that will serve as the obstacle:

    // Set up a torus that will block the particle stream
    var o = ActiveSceneRoot.AddGeometry( "Torus", "MeshSurface" );
    o.radius = 1; sectionradius = 0.25; o.posy = 5;

3. Apply the obstacle to the particle cloud using the AddParticleObstacle command:

    AddParticleObstacle( pcloud, o );

An obstacle property now appears nested under the particle operator in the scene explorer:

| You can access the obstacle nested under the particle operator by checking for the ObstacleProp type among the particle operator’s children. For more information, see Accessing the Emitter Property.

To Create and Apply a Goal to a Particle Cloud

1. Start by getting a pointer to the particle cloud.

    CreateParticleCloud( "", "Grid" );
    var pcloud = ActiveSceneRoot.FindChild( "", siCloudPrimType );

2. Add a 3d scene object that will serve as the goal:

    var g = ActiveSceneRoot.AddGeometry( "Grid", "MeshSurface" );
    g.posy = 15; g.ulength = 3; g.vlength = 3; g.subdivu = 4; g.subdivv = 4;

3. Apply the goal to the particle cloud using the AddParticleGoal command:

    AddParticleGoal( pcloud, g );

A goal property now appears nested under the particle operator in the scene explorer:

| You can access the goal nested under the particle operator by checking for the ParticleGoal type among the particle operator’s children. For more information, see Accessing the Emitter Property.