<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel>
    <title>murphy.metafnord.org</title>
    <link>murphy.metafnord.org</link>
    <description>on this site in 1897.. nothing happened</description>
    <language>en</language>
    <copyright>Murphy</copyright>
    <pubDate></pubDate>
    
    <item>
      <title>Squirrel physics!</title>
      <description>
      <![CDATA[
      <p>ohai! Recently I found myself needing some diversion again, so I decided to do some game programming again. Javascript has gotten a lot of nice libs for game programming lately, but physics engines somehow aren't quite there yet imho. </p>

<p>The only engines I know of in JS are ports of either Box2D or Bullet. My thoughts about them so far:</p>

<ul>
<li>There are two Javascript ports of <strong>Bullet</strong>: (<a href="https://github.com/adambom/bullet.js/">bullet.js</a> and <a href="https://github.com/kripken/ammo.js/">ammo.js</a>) but I don't think they perform so well with many objects due to Bullet being a 3D engine.</li>
<li><strong>Box2D</strong> also has two ports (<a href="http://box2d-js.sourceforge.net/">Box2dJS</a> and <a href="http://code.google.com/p/box2dweb/">Box2dWeb</a>). I just don't like the Box2D API, that's pretty much all. Box2dJS also is outdated and requires Prototype (for whatever reason).</li>
<li>With the exception of bullet.js all of these have been converted from C or Actionscript to Javascript.</li>
</ul>

<p>The last point is especially important to me, because that means they will most certainly clutter the global namespace. I started using <a href="http://tagneto.blogspot.com/2011/04/on-inventing-js-module-formats-and.html">AMD script loaders</a> for almost all of my projects in the last months and I really don't want to go back to this global mess.. (:
So I decided to take a shot at doing a physics engine port that's AMD compatible and has a nice API. </p>

<p>The <a href="http://chipmunk-physics.net/">Chipmunk engine</a> has a really nice API, so I chose to port that. After about two months of work besides work and exams I finally reached a point where most parts work and I feel comfortable to put it out. </p>

<p>I still consider it to be an early alpha version, so it's probably not recommend to use it in any serious project yet. Nevertheless, you can <a href="http://github.com/Moerphy/Chipmunk.js">check out the code on Github</a>.</p>

<p><img src="../_img/blog/squirrel.jpg" width="300px" height="225px" /></p>

<p>It's not a 1:1 port, since Chipmunk is written in C and I wanted an object oriented library. But it's a really close port when it comes to naming things. For instance <em>cpSpaceAddShape(space, shape)</em> in Chipmunk became <em>space.addShape(shape)</em> (space being an instance of cp/Space) in Chipmunk.js. I think I managed to stay as close as possible to the method signatures of Chipmunk.</p>

<p>Alright, here's the current state:</p>

<p><strong>Features:</strong></p>

<ul>
<li>Collision primitives for segments, circles and convex polygons</li>
<li>Uses fast contact persistence algorithm by Erin Catto (of Box2D fame)</li>
<li>Neat constraints like damped springs or motors.</li>
<li>Almost no dependencies. Chipmunk.js only requires (he he he) an AMD script loader.</li>
<li>No global namespace pollution. I'm <em>not</em> in your global, polluting your windowz. (o:</li>
</ul>

<p><strong>To do:</strong></p>

<ul>
<li>Sleeping bodies not supported. The code is already ported, but contains a crucial bug that leads to a freezing browser. More in <a href="https://github.com/Moerphy/Chipmunk.js/issues/1">this issue</a> on Github.</li>
<li>Write some unit tests for all classes.</li>
<li>Almost no optimization for Javascript in place. Still very close to the original C code. I want to do that once all important features are done and tested.</li>
<li>Find a tool for JS code documentation that does not suck that bad and make some nice API docs.</li>
</ul>

<p><strong>Demos:</strong></p>

<p>I made a page where I will put a few demos (two until now) <a href="http://chipmunk.metafnord.org">here</a> and other stuff such as API docs.</p>

<p><strong>TLDR;</strong></p>

<p>OOP-port of <a href="http://chipmunk-physics.net">Chipmunk</a> to Javascript; still alpha; <a href="http://github.com/Moerphy/Chipmunk.js">Code here</a>; <a href="http://chipmunk.metafnord.org">Demos here</a>; API docs coming as soon as possible.</p>
      ]]>
      </description>
      <link>../blog/Squirrel-physics!.html</link>
      <author>Murphy</author>
      <guid>../blog/Squirrel-physics!.html</guid>
      <pubDate>22.11.2011</pubDate>
    </item>
    <item>
      <title>More dizziness for the masses!</title>
      <description>
      <![CDATA[
      <p>A few people might have noticed that the <a href="http://dizzy.metafnord.org/editor">Dizzy editor</a> now (finally) has an user interface that one can use without wanting to puke (at least I hope so).
In the old version much of the UI was made in the SVG file itself (like the Zebra), which wasn't exactly a good idea.</p>

<p>So I moved (almost) everything out of the SVG and into the surrounding page. </p>

<p>In my opinion this is a much cleaner approach, althought the Zebra might not look as nice now as it has before.</p>

<p>Since it's not an image anymore but basically just a few divs with some CSS magic, it looks quite different in most browsers. 
Check this out:</p>

<p><a href="../_img/blog/htmlzebra.jpg"><img src="../_img/blog/htmlzebra.jpg" width="300px" height="100px" /></a></p>

<p>This is due to the way Browsers handle dotted/dashed borders in combination with border radius (see <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=382721">this issue</a>), but an issue that does not affect the functionality and I hope it will be fixed soon.</p>

<p>Anyway, here's what's new in the editor so far:</p>

<p><strong>New features:</strong></p>

<ul>
<li>Link to remote images</li>
<li>Load and save SVG presentation</li>
<li>Modify embedded stylesheet</li>
<li>change the z-index of groups (through the new zebra-toolbar)</li>
</ul>

<p><strong>Missing features:</strong></p>

<ul>
<li>More tools for drawing stuff on the canvas, like lines, arrows, circles...</li>
<li>More options for stuff on the page. Includes font options for text, color chooser, etc..</li>
<li>More jQuery. (o:</li>
</ul>

<p><strong>Known bugs:</strong></p>

<ul>
<li>Saving a SVG that contains an image does not work in Chrome (this browser has so many problems with that Feature..)</li>
<li>Changing the font-size through the stylesheet does not change the line height of multiline text</li>
<li>Firefox captures too many keys in default mode (should only capture letters and backspace)</li>
</ul>

<p>Another really awesome thing is that it seems like Internet Explorer 9 finally has decent SVG support! I had a look at IE9 a few days ago and at least the demo on the Dizzy page worked. </p>

<p>Once I find the time to install a Windows VM on my machine I will test the editor and report back to you (;</p>
      ]]>
      </description>
      <link>../blog/More-dizziness-for-the-masses!.html</link>
      <author>Murphy</author>
      <guid>../blog/More-dizziness-for-the-masses!.html</guid>
      <pubDate>05.04.2011</pubDate>
    </item>
    <item>
      <title>Your slides make me dizzy</title>
      <description>
      <![CDATA[
      <p>I just pushed a beta version of the <a href="http://dizzy.metafnord.org">new page for dizzy.js</a> online. <br />
It still lacks content, but it contains a feature I've been working on quite some time now: <a href="http://dizzy.metafnord.org/editor">an editor</a> (: <br />
Until now, new presentations had to be done by hand or in Inkscape, but I hope this won't be neccessary anymore.  </p>

<p>The editor is part of the new version 0.4.0, codename: "Forever alone" (yes, I do use internet memes as code names).  </p>

<p><strong>The core features are supported:</strong></p>

<ul>
<li>Create and delete text</li>
<li>Drag images from the file system on the canvas (I'm kinda proud this works so well), in FF and Chrome</li>
<li>Create and modify path through nodes</li>
<li>Presentation mode</li>
<li>Save SVG (somewhat buggy in Chrome)</li>
</ul>

<p>Of course there are quite a few bugs and a lot of features I do want to have in the editor:</p>

<p><strong>Missing features:</strong></p>

<ul>
<li>Loading a locally save SVG file to the editor</li>
<li>Adding images in Browsers that don't support dragging from the file system (through linking)</li>
<li>More tools for drawing stuff on the canvas, like lines, arrows, circles...</li>
<li>More options for stuff on the page. Includes font options for text, color chooser, etc..</li>
<li>Moar jQuery. (o:</li>
</ul>

<p><strong>Known bugs:</strong></p>

<ul>
<li>Saving a SVG that contains an image does not work in Chrome (this browser has so many problems with that Feature..)</li>
<li>Some other, that I forgot just now.</li>
</ul>

<p>I'm going to push the changes to github soon, want to clean up a little first. (; <br />
So, go ahead and try it. It would be awesome if you'd report bugs and quirks you find and give some feedback in general.</p>
      ]]>
      </description>
      <link>../blog/Your-slides-make-me-dizzy.html</link>
      <author>Murphy</author>
      <guid>../blog/Your-slides-make-me-dizzy.html</guid>
      <pubDate>10.02.2011</pubDate>
    </item>
    
  </channel>
</rss>