<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to Path</title><link>https://sourceforge.net/p/hpg-projects2/wiki/Path/</link><description>Recent changes to Path</description><atom:link href="https://sourceforge.net/p/hpg-projects2/wiki/Path/feed" rel="self"/><language>en</language><lastBuildDate>Sun, 07 Apr 2024 02:45:15 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/hpg-projects2/wiki/Path/feed" rel="self" type="application/rss+xml"/><item><title>Path modified by Hugh Greene</title><link>https://sourceforge.net/p/hpg-projects2/wiki/Path/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;A &lt;strong&gt;path&lt;/strong&gt; is a resource in ENIGMA which allows instances to be moved&lt;br/&gt;
along a straight or a curved line. Paths can be made in LGM path editor&lt;br/&gt;
and stored in the executable itself or be created at runtime.&lt;/p&gt;
&lt;h2 id="uses"&gt;Uses&lt;/h2&gt;
&lt;p&gt;Paths are very useful for smooth movement and animations. They are also&lt;br/&gt;
used in &lt;a class="" href="../motion_planning" title="wikilink"&gt;motion planning&lt;/a&gt;. Instances can be&lt;br/&gt;
assigned to paths and it will move along it with the given speed and&lt;br/&gt;
direction.&lt;/p&gt;
&lt;h2 id="functions"&gt;Functions&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Creating and modifying paths:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;- Adds an empty path and returns its id which is then used in other&lt;br/&gt;
    functions.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;- Destroys the path with the given path id and frees the memory&lt;br/&gt;
    associated with it.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;- Duplicates the path with the given path id and returns the id of&lt;br/&gt;
    the copy.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;- Copies the path from path source (srcid) to path id.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;- The same as path_copy and is used just for compatibility.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;- Appends the path with given path id to path ind.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;- Adds a point to the path with the given path id, at position&lt;br/&gt;
    (x,y) and with the given speed factor. Remember that a factor of 100&lt;br/&gt;
    corresponds to the actual speed. Lower values mean slowing down and&lt;br/&gt;
    higher mean speeding up.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;- Inserts a point in the path with the given path id before point&lt;br/&gt;
    n, at position (x,y) and with the given speed factor.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;- Changes the point n in the path with the given path id to&lt;br/&gt;
    position (x,y) and the given speed factor.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;- Deletes the point n in the path with the given path id.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;- Clears all the points in the path, turning it into an empty path.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;- Reverses the path.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;- Mirrors the path horizontally (with respect to its center).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;- Flips the path vertically (with respect to its center).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;- Rotates the path counter clockwise over angle degrees (around its&lt;br/&gt;
    center).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;- Scales the path with the given factors (from its center).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;- Shifts the path over the given amount.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;- Sets the type of the path with the given path id (0=straight,&lt;br/&gt;
    1=smooth).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;- Sets whether the path must be closed (true) or open (false).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;- Sets the precision with which the smooth path is calculated&lt;br/&gt;
    (should lie between 1 and 8).&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Getting path information:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;- Returns whether a path with the given path id exists.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;- Returns the length of the path with the given path id.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;- Returns the type the path with the given path id (0=straight,&lt;br/&gt;
    1=smooth).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;- Returns whether the path is closed (true) or not (false).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;- Returns the precision used for creating smoothed paths.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;- Returns the x position of the paths center (the point around&lt;br/&gt;
    which path is scaled, rotated, mirrored and flipped).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;- Returns the y position of the paths center (the point around&lt;br/&gt;
    which path is scaled, rotated, mirrored and flipped).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;- Returns the number of defining points for the path.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;- Returns the x-coordinate of the n'th defining point for the path.&lt;br/&gt;
    0 is the first point.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;- Returns the y-coordinate of the n'th defining point for the path.&lt;br/&gt;
    0 is the first point.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;- Returns the speed factor for the n'th defining point for the&lt;br/&gt;
    path. 0 is the first point.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;- Returns the length for the n'th defining point for the path. 0 is&lt;br/&gt;
    the first point. This is mostly for debugging purposes. The returned&lt;br/&gt;
    value is in pixels.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;- Returns the x-coordinate at position pos for the path. pos must&lt;br/&gt;
    lie between 0 and 1.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;- Returns the y-coordinate at position pos for the path. pos must&lt;br/&gt;
    lie between 0 and 1.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;- Returns the speed factor at position pos for the path. pos must&lt;br/&gt;
    lie between 0 and 1.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;- Returns the path direction at position pos for the path. pos must&lt;br/&gt;
    lie between 0 and 1. It is always pointing from smaller pos to&lt;br/&gt;
    larger. So if the desired direction is reversed, then the 180 must&lt;br/&gt;
    be subtracted from the returned value.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Other:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;- Draws the indicated path in the room with its start at position&lt;br/&gt;
    (x,y). If absolute is true the path is drawn at the position where&lt;br/&gt;
    it was defined and the values of x and y are ignored. The function&lt;br/&gt;
    is mostly used for debugging, but can also be used for some nice&lt;br/&gt;
    effects (or showing where the instance is moving in an RTS for&lt;br/&gt;
    example). It uses current drawing color and alpha. Line pattern can&lt;br/&gt;
    be added by using&lt;br/&gt;
&lt;a class="" href="../Drawing_shapes#draw_set_line_pattern" title="wikilink"&gt;draw_set_line_pattern&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Hugh Greene</dc:creator><pubDate>Sun, 07 Apr 2024 02:45:15 -0000</pubDate><guid>https://sourceforge.netec66bac07e15f601c37beb1166f77e10e66e7058</guid></item></channel></rss>