Particle Component

From ANVEL Wiki
Jump to: navigation, search
Noun 336.png | Experimental: The Particle Component is an experimental feature in ANVEL 3.5.


The Particle component allows the visualization of particles through a prebuilt Ogre particle script. Particles are useful for effects such as explosions, water fountains, smoke (shown below), and dust, as they display a large number of simple renderables efficiently. The Particle component requires a reference to a uniquely named Ogre Particle script. See documentation on the particle script format at Ogre Particle Script documentation. 35-explosion-particle.gif


Name Type Description
Enabled bool Whether this particle is active
Position Vector3 Position offset from its parent object
CreationTime float64 Time of particle creation
Delay float64 Currently unused
AutoExpire bool If the particle emitter will be disabled after the particles have been emitted


ParticleComponent definition

Name Description Type Attributes Unit
Template Ogre template name string
Delay Emitter delay real
AutoExpire Expires after particle emission completed bool


Particle Components must currently be defined with XML definitions and cannot be dynamically created through API or Python scripting. However, upon specifying a definition in XML, users can attach these assets to other objects to create more complex behaviors.

XML Definitions

The Particle component utilizes the following XML structure to define a new particle object.

Attribute Description Required?
template Name of the Ogre particle script to utilize yes
autoExpire "True" if the particle is to shut down after its emitter is no longer emitting particles no


The following examples are complete, user-placeable objects. Add them to a new definition file or include them in an existing definition file. If creating a new file, verify the new definition file has an associated ANVEL package file, or add it to the user's AnvelInit.xml configuration file.

The following object definition describes an invisible object that will spawn a dust cloud that moves with the object. Note that the particle script "Vane/DustCloud" must exist for visualization of this object.

<object name="DustCloudObject" category="Particles" placeable="true" selectable="false">
		<ParticleComponent template="Vane/DustCloud" autoExpire="false">

The next definition creates an explosion, with both a fiery instantaneous blast and a plume of smoke, along with a basic cube to allow user manipulation. Note that this uses two separate particle components.

<object name="ExplosionObject" category="Particles" placeable="true" selectable="true">
        <ogre3d mesh="BasicShapeCube.mesh" shadows="off" zUp="true">
            <scale x=".001" y=".001" z=".001"/>
        <ParticleComponent template="Explosion_Anvel">
            <positionOffset x="0" y="0" z="0" />
            <orientationOffset w="1" x="0" y="0" z="0" />
        <ParticleComponent template="smoke2">
            <positionOffset x="0" y="0" z="0" />
            <orientationOffset w="1" x="0" y="0" z="0" />

See Also

Component System

Ogre Particle Script Documentation