[657] | 1 | <HTML> |
---|
| 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> |
---|
| 3 | <!-- Created on , 12 2006 by texi2html 1.64 --> |
---|
| 4 | <!-- |
---|
| 5 | Written by: Lionel Cons <Lionel.Cons@cern.ch> (original author) |
---|
| 6 | Karl Berry <karl@freefriends.org> |
---|
| 7 | Olaf Bachmann <obachman@mathematik.uni-kl.de> |
---|
| 8 | and many others. |
---|
| 9 | Maintained by: Olaf Bachmann <obachman@mathematik.uni-kl.de> |
---|
| 10 | Send bugs and suggestions to <texi2html@mathematik.uni-kl.de> |
---|
| 11 | |
---|
| 12 | --> |
---|
| 13 | <HEAD> |
---|
| 14 | <TITLE>OGRE Manual v1.0.7: Particle Scripts</TITLE> |
---|
| 15 | |
---|
| 16 | <META NAME="description" CONTENT="OGRE Manual v1.0.7: Particle Scripts"> |
---|
| 17 | <META NAME="keywords" CONTENT="OGRE Manual v1.0.7: Particle Scripts"> |
---|
| 18 | <META NAME="resource-type" CONTENT="document"> |
---|
| 19 | <META NAME="distribution" CONTENT="global"> |
---|
| 20 | <META NAME="Generator" CONTENT="texi2html 1.64"> |
---|
| 21 | <LINK TYPE="text/css" rel="stylesheet" href="../style.css"> |
---|
| 22 | </HEAD> |
---|
| 23 | |
---|
| 24 | <BODY LANG="" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#800080" ALINK="#FF0000"> |
---|
| 25 | |
---|
| 26 | <A NAME="SEC93"></A> |
---|
| 27 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> |
---|
| 28 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_20.html#SEC86"> < </A>]</TD> |
---|
| 29 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_14.html#SEC23"> Up </A>]</TD> |
---|
| 30 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_22.html#SEC97"> > </A>]</TD> |
---|
| 31 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="index.html#SEC_Top">Top</A>]</TD> |
---|
| 32 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_toc.html#SEC_Contents">Contents</A>]</TD> |
---|
| 33 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> |
---|
| 34 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_abt.html#SEC_About"> ? </A>]</TD> |
---|
| 35 | </TR></TABLE> |
---|
| 36 | <HR SIZE=1> |
---|
| 37 | <H2> 3.2 Particle Scripts </H2> |
---|
| 38 | <!--docid::SEC93::--> |
---|
| 39 | <P> |
---|
| 40 | |
---|
| 41 | Particle scripts allow you to define particle systems to be instantiated in your code without having to hard-code the settings themselves in your source code, allowing a very quick turnaround on any changes you make. Particle systems which are defined in scripts are used as templates, and multiple actual systems can be created from them at runtime.<BR><BR> |
---|
| 42 | </P><P> |
---|
| 43 | |
---|
| 44 | <A NAME="SEC94"></A> |
---|
| 45 | <H2> Loading scripts </H2> |
---|
| 46 | <!--docid::SEC94::--> |
---|
| 47 | <P> |
---|
| 48 | |
---|
| 49 | Particle system scripts are loaded at initialisation time by the system: by default it looks in all common resource locations (see Root::addResourceLocation) for files with the '.particle' extension and parses them. If you want to parse files with a different extension, use the ParticleSystemManager::getSingleton().parseAllSources method with your own extension, or if you want to parse an individual file, use ParticleSystemManager::getSingleton().parseScript.<BR><BR> |
---|
| 50 | </P><P> |
---|
| 51 | |
---|
| 52 | Once scripts have been parsed, your code is free to instantiate systems based on them using the ParticleSystemManager::getSingleton().createSystem() method which can take both a name for the new system, and the name of the template to base it on (this template name is in the script).<BR><BR> |
---|
| 53 | </P><P> |
---|
| 54 | |
---|
| 55 | <A NAME="SEC95"></A> |
---|
| 56 | <H2> Format </H2> |
---|
| 57 | <!--docid::SEC95::--> |
---|
| 58 | <P> |
---|
| 59 | |
---|
| 60 | Several particle systems may be defined in a single script. The script format is pseudo-C++, with sections delimited by curly braces ({}), and comments indicated by starting a line with '//' (note, no nested form comments allowed). The general format is shown below in a typical example: |
---|
| 61 | <TABLE><tr><td> </td><td class=example><pre>// A sparkly purple fountain |
---|
| 62 | Examples/PurpleFountain |
---|
| 63 | { |
---|
| 64 | material Examples/Flare2 |
---|
| 65 | particle_width 20 |
---|
| 66 | particle_height 20 |
---|
| 67 | cull_each false |
---|
| 68 | quota 10000 |
---|
| 69 | billboard_type oriented_self |
---|
| 70 | |
---|
| 71 | // Area emitter |
---|
| 72 | emitter Point |
---|
| 73 | { |
---|
| 74 | angle 15 |
---|
| 75 | emission_rate 75 |
---|
| 76 | time_to_live 3 |
---|
| 77 | direction 0 1 0 |
---|
| 78 | velocity_min 250 |
---|
| 79 | velocity_max 300 |
---|
| 80 | colour_range_start 1 0 0 |
---|
| 81 | colour_range_end 0 0 1 |
---|
| 82 | } |
---|
| 83 | |
---|
| 84 | // Gravity |
---|
| 85 | affector LinearForce |
---|
| 86 | { |
---|
| 87 | force_vector 0 -100 0 |
---|
| 88 | force_application add |
---|
| 89 | } |
---|
| 90 | |
---|
| 91 | // Fader |
---|
| 92 | affector ColourFader |
---|
| 93 | { |
---|
| 94 | red -0.25 |
---|
| 95 | green -0.25 |
---|
| 96 | blue -0.25 |
---|
| 97 | } |
---|
| 98 | } |
---|
| 99 | </pre></td></tr></table><BR><BR> |
---|
| 100 | Every particle system in the script must be given a name, which is the line before the first opening '{', in the example this is 'Examples/PurpleFountain'. This name must be globally unique. It can include path characters (as in the example) to logically divide up your particle systems, and also to avoid duplicate names, but the engine does not treat the name as hierarchical, just as a string.<BR><BR> |
---|
| 101 | </P><P> |
---|
| 102 | |
---|
| 103 | A system can have top-level attributes set using the scripting commands available, such as 'quota' to set the maximum number of particles allowed in the system. Emitters (which create particles) and affectors (which modify particles) are added as nested definitions within the script. The parameters available in the emitter and affector sections are entirely dependent on the type of emitter / affector.<BR><BR> |
---|
| 104 | </P><P> |
---|
| 105 | |
---|
| 106 | For a detailed description of the core particle system attributes, see the list below: |
---|
| 107 | </P><P> |
---|
| 108 | |
---|
| 109 | <A NAME="SEC96"></A> |
---|
| 110 | <H3> Available Particle System Attributes </H3> |
---|
| 111 | <!--docid::SEC96::--> |
---|
| 112 | <UL> |
---|
| 113 | <LI> |
---|
| 114 | <A HREF="manual_22.html#SEC98">quota</A> |
---|
| 115 | <LI> |
---|
| 116 | <A HREF="manual_22.html#particle_material">material</A> |
---|
| 117 | <LI> |
---|
| 118 | <A HREF="manual_22.html#SEC100">particle_width</A> |
---|
| 119 | <LI> |
---|
| 120 | <A HREF="manual_22.html#SEC101">particle_height</A> |
---|
| 121 | <LI> |
---|
| 122 | <A HREF="manual_22.html#SEC102">cull_each</A> |
---|
| 123 | <LI> |
---|
| 124 | <A HREF="manual_22.html#SEC103">billboard_type</A> |
---|
| 125 | <LI> |
---|
| 126 | <A HREF="manual_22.html#SEC104">common_direction</A> |
---|
| 127 | </UL> |
---|
| 128 | See also: <A HREF="manual_23.html#SEC105">3.2.2 Particle Emitters</A>, <A HREF="manual_26.html#SEC129">3.2.5 Particle Affectors</A> |
---|
| 129 | <P> |
---|
| 130 | |
---|
| 131 | <A NAME="Particle System Attributes"></A> |
---|
| 132 | <HR SIZE=1> |
---|
| 133 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> |
---|
| 134 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_20.html#SEC86"> < </A>]</TD> |
---|
| 135 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_14.html#SEC23"> Up </A>]</TD> |
---|
| 136 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_22.html#SEC97"> > </A>]</TD> |
---|
| 137 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="index.html#SEC_Top">Top</A>]</TD> |
---|
| 138 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_toc.html#SEC_Contents">Contents</A>]</TD> |
---|
| 139 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> |
---|
| 140 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_abt.html#SEC_About"> ? </A>]</TD> |
---|
| 141 | </TR></TABLE> |
---|
| 142 | <BR> |
---|
| 143 | <FONT SIZE="-1"> |
---|
| 144 | This document was generated |
---|
| 145 | by <I>Steve Streeting</I> on <I>, 12 2006</I> |
---|
| 146 | using <A HREF="http://www.mathematik.uni-kl.de/~obachman/Texi2html |
---|
| 147 | "><I>texi2html</I></A> |
---|
| 148 | |
---|
| 149 | </BODY> |
---|
| 150 | </HTML> |
---|