86 lines
3.3 KiB
HTML
86 lines
3.3 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
|
|
<html>
|
|
<head>
|
|
<title>Attractors</title>
|
|
<link href="style.css" rel="stylesheet" type="text/css">
|
|
</head>
|
|
<body background="images/back.gif">
|
|
<!--START-->
|
|
|
|
<h3>Attractors</h3>
|
|
|
|
Besides emitters a particle system can also contain attractors.
|
|
An attractor attracts the particles (or pushes them away).
|
|
A particle system can have multiple attractors. You are though recommended
|
|
to use few of these because they will slow down the processing of the
|
|
particles. An attractor has the following properties:
|
|
|
|
<ul>
|
|
<li><tt><b>x,y</b></tt>
|
|
indicate the position of the attractor.</li>
|
|
<li><tt><b>force</b></tt>
|
|
indicates the attracting force of the attractor. How the force
|
|
acts on the particles depends on the following parameters.</li>
|
|
<li><tt><b>dist</b></tt>
|
|
indicates the maximal distance at which the attractor has effect.
|
|
Only particles closer that this distance to the attractor will be attracted.</li>
|
|
<li><tt><b>kind</b></tt>
|
|
indicates the kind of attractor. The following values exist</li>
|
|
<ul>
|
|
<li><tt>ps_force_constant</tt>
|
|
indicates that the force is constant independent of the distance.</li>
|
|
<li><tt>ps_force_linear</tt>
|
|
indicates a linearly growing force. At the maximal distance the force
|
|
is 0 while at the position of the attractor it attains the given value.</li>
|
|
<li><tt>ps_force_quadratic</tt>
|
|
indicates that the force grows quadratic.</li>
|
|
</ul>
|
|
<li><tt><b>additive</b></tt>
|
|
indicates whether the force is added to the speed and direction in each
|
|
step (true) or only applied to the position of the particle (false).
|
|
When additive the particle will accelerate towards the attractor
|
|
while with a non-additive force it will move there with constant speed.</li>
|
|
</ul>
|
|
|
|
<p>
|
|
The following functions exist to define attractors. Note that each of them
|
|
gets the index of the particle system to which it belongs as a first argument.
|
|
|
|
<p>
|
|
<blockquote>
|
|
<tt><b>part_attractor_create(ps)</b></tt>
|
|
Creates a new attractor in the given particle system. It returns the index of the attractor.
|
|
This index must be used in all calls below to set the properties of the attractor.<br>
|
|
<tt><b>part_attractor_destroy(ps,ind)</b></tt>
|
|
Destroys attractor ind in the particle system.
|
|
Call this if you don't need it anymore to save space.<br>
|
|
<tt><b>part_attractor_destroy_all(ps)</b></tt>
|
|
Destroys all attractors in the particle system that have been created.<br>
|
|
<tt><b>part_attractor_exists(ps,ind)</b></tt>
|
|
Returns whether the indicated attractor exists in the particle system.<br>
|
|
<tt><b>part_attractor_clear(ps,ind)</b></tt>
|
|
Clears the attractor ind to its default settings.<br>
|
|
<tt><b>part_attractor_position(ps,ind,x,y)</b></tt>
|
|
Sets the position of attractor ind to (x,y).<br>
|
|
<tt><b>part_attractor_force(ps,ind,force,dist,kind,aditive)</b></tt>
|
|
Sets the force parameters of attractor ind.<br>
|
|
</blockquote>
|
|
|
|
<!--END-->
|
|
</body>
|
|
</html>
|
|
|
|
<!-- KEYWORDS
|
|
part_attractor_create()
|
|
part_attractor_destroy()
|
|
part_attractor_destroy_all()
|
|
part_attractor_exists()
|
|
part_attractor_clear()
|
|
part_attractor_position()
|
|
part_attractor_force()
|
|
ps_force_constant
|
|
ps_force_linear
|
|
ps_force_quadratic
|
|
|
|
--> |