source: OGRE/trunk/ogrenew/Docs/manual/manual_26.html @ 692

Revision 692, 7.5 KB checked in by mattausch, 19 years ago (diff)

adding ogre 1.2 and dependencies

RevLine 
[692]1<HTML>
2<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
3<!-- Created on , 12 2006 by texi2html 1.64 -->
4<!--
5Written 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.
9Maintained by: Olaf Bachmann <obachman@mathematik.uni-kl.de>
10Send bugs and suggestions to <texi2html@mathematik.uni-kl.de>
11 
12-->
13<HEAD>
14<TITLE>OGRE Manual v1.2.0 ('Dagon'): Particle Scripts</TITLE>
15
16<META NAME="description" CONTENT="OGRE Manual v1.2.0 ('Dagon'): Particle Scripts">
17<META NAME="keywords" CONTENT="OGRE Manual v1.2.0 ('Dagon'): 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="SEC145"></A>
27<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
28<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_25.html#SEC144"> &lt; </A>]</TD>
29<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_13.html#SEC22"> Up </A>]</TD>
30<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_27.html#SEC149"> &gt; </A>]</TD>
31<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <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.3 Particle Scripts </H2>
38<!--docid::SEC145::-->
39<P>
40
41Particle 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="SEC146"></A>
45<H2> Loading scripts   </H2>
46<!--docid::SEC146::-->
47<P>
48
49Particle 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
52Once 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="SEC147"></A>
56<H2> Format   </H2>
57<!--docid::SEC147::-->
58<P>
59
60Several 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>&nbsp;</td><td class=example><pre>// A sparkly purple fountain
62Examples/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>
100Every 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
103A 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
106For a detailed description of the core particle system attributes, see the list below:
107</P><P>
108
109<A NAME="SEC148"></A>
110<H3> Available Particle System Attributes </H3>
111<!--docid::SEC148::-->
112<UL>
113<LI>
114<A HREF="manual_27.html#SEC150">quota</A>
115<LI>
116<A HREF="manual_27.html#particle_material">material</A>
117<LI>
118<A HREF="manual_27.html#SEC152">particle_width</A>
119<LI>
120<A HREF="manual_27.html#SEC153">particle_height</A>
121<LI>
122<A HREF="manual_27.html#SEC154">cull_each</A>
123<LI>
124<A HREF="manual_27.html#SEC158">billboard_type</A>
125<LI>
126<A HREF="manual_27.html#SEC159">billboard_origin</A>
127<LI>
128<A HREF="manual_27.html#SEC160">billboard_rotation_type</A>
129<LI>
130<A HREF="manual_27.html#SEC161">common_direction</A>
131<LI>
132<A HREF="manual_27.html#SEC162">common_up_vector</A>
133<LI>
134<A HREF="manual_27.html#particle_renderer">renderer</A>
135<LI>
136<A HREF="manual_27.html#particle_sorted">sorted</A>
137<LI>
138<A HREF="manual_27.html#particle_localspace">local_space</A>
139<LI>
140<A HREF="manual_27.html#particle_point_rendering">point_rendering</A>
141<LI>
142<A HREF="manual_27.html#particle_accurate_facing">accurate_facing</A>
143<LI>
144<A HREF="manual_27.html#SEC165">iteration_interval</A>
145<LI>
146<A HREF="manual_27.html#SEC166">nonvisible_update_timeout</A>
147</UL>
148See also: <A HREF="manual_28.html#SEC167">3.3.2 Particle Emitters</A>, <A HREF="manual_31.html#SEC191">3.3.5 Particle Affectors</A>
149<P>
150
151<A NAME="Particle System Attributes"></A>
152<HR SIZE=1>
153<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
154<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_25.html#SEC144"> &lt; </A>]</TD>
155<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_13.html#SEC22"> Up </A>]</TD>
156<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_27.html#SEC149"> &gt; </A>]</TD>
157<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="index.html#SEC_Top">Top</A>]</TD>
158<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_toc.html#SEC_Contents">Contents</A>]</TD>
159<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
160<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_abt.html#SEC_About"> ? </A>]</TD>
161</TR></TABLE>
162<BR> 
163<FONT SIZE="-1">
164This document was generated
165by <I>Steve Streeting</I> on <I>, 12 2006</I>
166using <A HREF="http://www.mathematik.uni-kl.de/~obachman/Texi2html
167"><I>texi2html</I></A>
168
169</BODY>
170</HTML>
Note: See TracBrowser for help on using the repository browser.