CreateEffect

Creates an ITerrainEffect80 animated effect object.

 

JavaScript

 

CreateEffect(

       Position,

       EffectsXML,

       GroupID,

       Description)

 

C#

 

ITerrainEffect80 CreateEffect(

       IPosition80 Position,

       string EffectsXML = "",

       string GroupID = "",

       string Description = "")

 

C++

 

HRESULT CreateEffect(

       IPosition80* Position,

       BSTR EffectsXML,

       BSTR GroupID,

       BSTR Description,

       ITerrainEffect80** pITerrainEffect80);

 

Parameters

Position

An IPosition80 representing the position and orientation of the object on the terrain.

EffectsXML

An XML that defines the animation effect’s particle system parameters, such as the shape and size of the particle emitter, and shape and scale factor of the volume that the particles are emitted into. This XML is returned by ITerrainEffect80.EffectXML. SeeParticleEditor Parameters” in the “Effects” chapter in the TerraExplorer User Manual for a description of the XML’s particle system parameters.

GroupID

The Project Tree group in which the effect object is created. If it is set to an empty string, the object is created under the root. You can obtain the GroupID by one of the following methods:

·          Create the group using IProjectTree80.CreateGroup.

·          Find the group, if you know the name, using IProjectTree80.FindItem.

·          Traverse the Tree using IProjectTree80 methods such as GetNextItem, until you come to the desired GroupID.

Description

The name of the effect object as it appears in the Project Tree. If an empty string is passed into this parameter, TerraExplorer assigns it a unique name.

Return Value

pITerrainEffect80

An ITerrainEffect80, representing the newly created effect.

Exceptions

See: HRESULT Return Values for a list of possible values returned by the HRESULT.