Add metacircle

This commit is contained in:
schmelczerandras 2020-10-02 17:37:47 +02:00
parent 158d2f462f
commit 10b59a39be
20 changed files with 776 additions and 239 deletions

View file

@ -126,7 +126,7 @@
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/schmelczerandras/sdf-2d/blob/81eb022/src/drawables/shapes/rotated-rectangle.ts#L46">drawables/shapes/rotated-rectangle.ts:46</a></li>
<li>Defined in <a href="https://github.com/schmelczerandras/sdf-2d/blob/158d2f4/src/drawables/shapes/rotated-rectangle.ts#L46">drawables/shapes/rotated-rectangle.ts:46</a></li>
</ul>
</aside>
<h4 class="tsd-parameters-title">Parameters</h4>
@ -154,7 +154,7 @@
<div class="tsd-signature tsd-kind-icon">center<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">vec2</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/schmelczerandras/sdf-2d/blob/81eb022/src/drawables/shapes/rotated-rectangle.ts#L48">drawables/shapes/rotated-rectangle.ts:48</a></li>
<li>Defined in <a href="https://github.com/schmelczerandras/sdf-2d/blob/158d2f4/src/drawables/shapes/rotated-rectangle.ts#L48">drawables/shapes/rotated-rectangle.ts:48</a></li>
</ul>
</aside>
</section>
@ -164,7 +164,7 @@
<div class="tsd-signature tsd-kind-icon">rotation<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/schmelczerandras/sdf-2d/blob/81eb022/src/drawables/shapes/rotated-rectangle.ts#L48">drawables/shapes/rotated-rectangle.ts:48</a></li>
<li>Defined in <a href="https://github.com/schmelczerandras/sdf-2d/blob/158d2f4/src/drawables/shapes/rotated-rectangle.ts#L48">drawables/shapes/rotated-rectangle.ts:48</a></li>
</ul>
</aside>
</section>
@ -174,7 +174,7 @@
<div class="tsd-signature tsd-kind-icon">size<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">vec2</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/schmelczerandras/sdf-2d/blob/81eb022/src/drawables/shapes/rotated-rectangle.ts#L48">drawables/shapes/rotated-rectangle.ts:48</a></li>
<li>Defined in <a href="https://github.com/schmelczerandras/sdf-2d/blob/158d2f4/src/drawables/shapes/rotated-rectangle.ts#L48">drawables/shapes/rotated-rectangle.ts:48</a></li>
</ul>
</aside>
</section>
@ -192,7 +192,7 @@
<aside class="tsd-sources">
<p>Overrides <a href="drawable.html">Drawable</a>.<a href="drawable.html#getobjecttoserialize">getObjectToSerialize</a></p>
<ul>
<li>Defined in <a href="https://github.com/schmelczerandras/sdf-2d/blob/81eb022/src/drawables/shapes/rotated-rectangle.ts#L60">drawables/shapes/rotated-rectangle.ts:60</a></li>
<li>Defined in <a href="https://github.com/schmelczerandras/sdf-2d/blob/158d2f4/src/drawables/shapes/rotated-rectangle.ts#L60">drawables/shapes/rotated-rectangle.ts:60</a></li>
</ul>
</aside>
<h4 class="tsd-parameters-title">Parameters</h4>
@ -219,7 +219,7 @@
<aside class="tsd-sources">
<p>Overrides <a href="drawable.html">Drawable</a>.<a href="drawable.html#mindistance">minDistance</a></p>
<ul>
<li>Defined in <a href="https://github.com/schmelczerandras/sdf-2d/blob/81eb022/src/drawables/shapes/rotated-rectangle.ts#L56">drawables/shapes/rotated-rectangle.ts:56</a></li>
<li>Defined in <a href="https://github.com/schmelczerandras/sdf-2d/blob/158d2f4/src/drawables/shapes/rotated-rectangle.ts#L56">drawables/shapes/rotated-rectangle.ts:56</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
@ -249,7 +249,7 @@
<aside class="tsd-sources">
<p>Overrides <a href="drawable.html">Drawable</a>.<a href="drawable.html#descriptor">descriptor</a></p>
<ul>
<li>Defined in <a href="https://github.com/schmelczerandras/sdf-2d/blob/81eb022/src/drawables/shapes/rotated-rectangle.ts#L9">drawables/shapes/rotated-rectangle.ts:9</a></li>
<li>Defined in <a href="https://github.com/schmelczerandras/sdf-2d/blob/158d2f4/src/drawables/shapes/rotated-rectangle.ts#L9">drawables/shapes/rotated-rectangle.ts:9</a></li>
</ul>
</aside>
<section class="tsd-panel tsd-member tsd-kind-variable tsd-parent-kind-object-literal">
@ -258,7 +258,7 @@
<div class="tsd-signature tsd-kind-icon">empty<span class="tsd-signature-symbol">:</span> <a href="rotatedrectangle.html" class="tsd-signature-type">RotatedRectangle</a><span class="tsd-signature-symbol"> = new RotatedRectangle(vec2.create(), vec2.create(), 0)</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/schmelczerandras/sdf-2d/blob/81eb022/src/drawables/shapes/rotated-rectangle.ts#L45">drawables/shapes/rotated-rectangle.ts:45</a></li>
<li>Defined in <a href="https://github.com/schmelczerandras/sdf-2d/blob/158d2f4/src/drawables/shapes/rotated-rectangle.ts#L45">drawables/shapes/rotated-rectangle.ts:45</a></li>
</ul>
</aside>
</section>
@ -268,7 +268,7 @@
<div class="tsd-signature tsd-kind-icon">shader<wbr>Combination<wbr>Steps<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol"> = [0, 1, 2, 3, 8, 16]</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/schmelczerandras/sdf-2d/blob/81eb022/src/drawables/shapes/rotated-rectangle.ts#L44">drawables/shapes/rotated-rectangle.ts:44</a></li>
<li>Defined in <a href="https://github.com/schmelczerandras/sdf-2d/blob/158d2f4/src/drawables/shapes/rotated-rectangle.ts#L44">drawables/shapes/rotated-rectangle.ts:44</a></li>
</ul>
</aside>
</section>
@ -278,7 +278,7 @@
<div class="tsd-signature tsd-kind-icon">uniform<wbr>Count<wbr>Macro<wbr>Name<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> = &quot;ROTATED_RECTANGLE_COUNT&quot;</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/schmelczerandras/sdf-2d/blob/81eb022/src/drawables/shapes/rotated-rectangle.ts#L43">drawables/shapes/rotated-rectangle.ts:43</a></li>
<li>Defined in <a href="https://github.com/schmelczerandras/sdf-2d/blob/158d2f4/src/drawables/shapes/rotated-rectangle.ts#L43">drawables/shapes/rotated-rectangle.ts:43</a></li>
</ul>
</aside>
</section>
@ -288,7 +288,7 @@
<div class="tsd-signature tsd-kind-icon">property<wbr>Uniform<wbr>Mapping<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">object</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/schmelczerandras/sdf-2d/blob/81eb022/src/drawables/shapes/rotated-rectangle.ts#L38">drawables/shapes/rotated-rectangle.ts:38</a></li>
<li>Defined in <a href="https://github.com/schmelczerandras/sdf-2d/blob/158d2f4/src/drawables/shapes/rotated-rectangle.ts#L38">drawables/shapes/rotated-rectangle.ts:38</a></li>
</ul>
</aside>
<section class="tsd-panel tsd-member tsd-kind-variable tsd-parent-kind-object-literal">
@ -297,7 +297,7 @@
<div class="tsd-signature tsd-kind-icon">bottom<wbr>Center<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> = &quot;rotatedRectangleBottomCenters&quot;</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/schmelczerandras/sdf-2d/blob/81eb022/src/drawables/shapes/rotated-rectangle.ts#L40">drawables/shapes/rotated-rectangle.ts:40</a></li>
<li>Defined in <a href="https://github.com/schmelczerandras/sdf-2d/blob/158d2f4/src/drawables/shapes/rotated-rectangle.ts#L40">drawables/shapes/rotated-rectangle.ts:40</a></li>
</ul>
</aside>
</section>
@ -307,7 +307,7 @@
<div class="tsd-signature tsd-kind-icon">top<wbr>Center<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> = &quot;rotatedRectangleTopCenters&quot;</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/schmelczerandras/sdf-2d/blob/81eb022/src/drawables/shapes/rotated-rectangle.ts#L39">drawables/shapes/rotated-rectangle.ts:39</a></li>
<li>Defined in <a href="https://github.com/schmelczerandras/sdf-2d/blob/158d2f4/src/drawables/shapes/rotated-rectangle.ts#L39">drawables/shapes/rotated-rectangle.ts:39</a></li>
</ul>
</aside>
</section>
@ -317,7 +317,7 @@
<div class="tsd-signature tsd-kind-icon">width<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> = &quot;rotatedRectangleWidths&quot;</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/schmelczerandras/sdf-2d/blob/81eb022/src/drawables/shapes/rotated-rectangle.ts#L41">drawables/shapes/rotated-rectangle.ts:41</a></li>
<li>Defined in <a href="https://github.com/schmelczerandras/sdf-2d/blob/158d2f4/src/drawables/shapes/rotated-rectangle.ts#L41">drawables/shapes/rotated-rectangle.ts:41</a></li>
</ul>
</aside>
</section>
@ -328,7 +328,7 @@
<div class="tsd-signature tsd-kind-icon">sdf<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">object</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/schmelczerandras/sdf-2d/blob/81eb022/src/drawables/shapes/rotated-rectangle.ts#L10">drawables/shapes/rotated-rectangle.ts:10</a></li>
<li>Defined in <a href="https://github.com/schmelczerandras/sdf-2d/blob/158d2f4/src/drawables/shapes/rotated-rectangle.ts#L10">drawables/shapes/rotated-rectangle.ts:10</a></li>
</ul>
</aside>
<section class="tsd-panel tsd-member tsd-kind-variable tsd-parent-kind-object-literal">
@ -337,7 +337,7 @@
<div class="tsd-signature tsd-kind-icon">distance<wbr>Function<wbr>Name<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> = &quot;rotatedRectangleMinDistance&quot;</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/schmelczerandras/sdf-2d/blob/81eb022/src/drawables/shapes/rotated-rectangle.ts#L36">drawables/shapes/rotated-rectangle.ts:36</a></li>
<li>Defined in <a href="https://github.com/schmelczerandras/sdf-2d/blob/158d2f4/src/drawables/shapes/rotated-rectangle.ts#L36">drawables/shapes/rotated-rectangle.ts:36</a></li>
</ul>
</aside>
</section>
@ -347,7 +347,7 @@
<div class="tsd-signature tsd-kind-icon">shader<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> = &#x60;uniform vec2 rotatedRectangleTopCenters[ROTATED_RECTANGLE_COUNT];uniform vec2 rotatedRectangleBottomCenters[ROTATED_RECTANGLE_COUNT];uniform float rotatedRectangleWidths[ROTATED_RECTANGLE_COUNT];float rotatedRectangleMinDistance(vec2 target, out float colorIndex) {colorIndex &#x3D; 4.0;float minDistance &#x3D; 1000.0;for (int i &#x3D; 0; i &lt; ROTATED_RECTANGLE_COUNT; i++) {vec2 top &#x3D; rotatedRectangleTopCenters[i];vec2 bottom &#x3D; rotatedRectangleBottomCenters[i];float height &#x3D; length(bottom - top);vec2 d &#x3D; (bottom - top) / height;vec2 q &#x3D; (target - (top + bottom) * 0.5);q &#x3D; mat2(d.x, -d.y, d.y, d.x) * q;q &#x3D; abs(q) - vec2(height, rotatedRectangleWidths[i]) * 0.5;float dist &#x3D; length(max(q, 0.0)) + min(max(q.x, q.y), 0.0);minDistance &#x3D; min(minDistance, dist);}return minDistance;}&#x60;</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/schmelczerandras/sdf-2d/blob/81eb022/src/drawables/shapes/rotated-rectangle.ts#L12">drawables/shapes/rotated-rectangle.ts:12</a></li>
<li>Defined in <a href="https://github.com/schmelczerandras/sdf-2d/blob/158d2f4/src/drawables/shapes/rotated-rectangle.ts#L12">drawables/shapes/rotated-rectangle.ts:12</a></li>
</ul>
</aside>
</section>
@ -374,12 +374,18 @@
<li class=" tsd-kind-class">
<a href="drawable.html" class="tsd-kind-icon">Drawable</a>
</li>
<li class=" tsd-kind-class">
<a href="droplet.html" class="tsd-kind-icon">Droplet</a>
</li>
<li class=" tsd-kind-class">
<a href="flashlight.html" class="tsd-kind-icon">Flashlight</a>
</li>
<li class=" tsd-kind-class">
<a href="invertedtunnel.html" class="tsd-kind-icon">Inverted<wbr>Tunnel</a>
</li>
<li class=" tsd-kind-class">
<a href="metacircle.html" class="tsd-kind-icon">Meta<wbr>Circle</a>
</li>
</ul>
<ul class="current">
<li class="current tsd-kind-class">
@ -410,9 +416,6 @@
</li>
</ul>
<ul class="after-current">
<li class=" tsd-kind-class">
<a href="tunnel.html" class="tsd-kind-icon">Tunnel</a>
</li>
<li class=" tsd-kind-interface">
<a href="../interfaces/drawabledescriptor.html" class="tsd-kind-icon">Drawable<wbr>Descriptor</a>
</li>