Simple physics library

I have bundled up the rigid body physics engine from VDrift into the joerigidbody library.  This is a simple C++ rigid body physics library.  See the link above for more info.

Logitech Marble Mouse under Ubuntu 9.04

I upgraded to Ubuntu 9.04, and to get my logitech marble mouse trackball to behave how I like (left small button middle clicks and also scrolls if you hold it down), I created /etc/hal/fdi/policy/mouse-wheel.fdi with this inside:

<?xml version="1.0" encoding="ISO-8859-1"?>
<deviceinfo version="0.2">
  <device>
    <match key="info.product" string="Logitech USB Trackball">
<merge key="input.x11_options.Buttons" type="string">9</merge>
<merge key="input.x11_options.ButtonMapping" type="string">1 2 3 4 5 6 7 8 9</merge>
      <merge key="input.x11_options.EmulateWheel" type="string">true</merge>
      <merge key="input.x11_options.EmulateWheelButton" type="string">8</merge>
      <merge key="input.x11_options.Emulate3Buttons" type="string">false</merge>
<merge key="input.x11_options.XAxisMapping" type="string">6 7</merge>
<merge key="input.x11_options.YAxisMapping" type="string">4 5</merge>
<merge key="input.x11_options.ZAxisMapping" type="string">4 5</merge>
<merge key="input.x11_options.EmulateWheelTimeout" type="string">300</merge>
    </match>
  </device>
</deviceinfo>

joeserialize: a simple C++ serialization library

I wrote a simple, one-header serialization library and put it online here. The library allows you to load and save the state of a C++ object to a file, and comes with example text and binary formats.

Tetrigami

Tetrigami is an origami-themed tetromino game that I've been working on in my spare time with a chap named Jonathan Geer.  More info including screenshots and a download is here: venzon.org/tetrigami

Numerical Integration

I updated the VDrift wiki with a new analysis of various numerical integration methods. It provides some justification for using lower order integrators such as the Euler method.

http://wiki.vdrift.net/Numerical_Integration

Completed music piece – “An Idea”

I finally completed a musical composition I've been working on for a while.  It was a challenge for me because I had to promise myself I'd use no orchestral percussion (beyond a triangle) and no brass.  That's tough, because most of the stuff I do is highly rhythmic and textural.  So, I had to do lilting and melodic, instead.  Hard!  Anyway, here it is.  It's called "an idea" because that's what I called the file when I first played into Cubase and saved the idea.  I thought it ended up being a fitting title.

An Idea

Voradyne Integrated Dynamics

I don't think I mentioned this, but in 2008 I started a company called Voradyne Integrated Dynamics, LLC.  The name is intentionally a bit silly and vague.  The website is here:

http://www.voradyne.com/

The company doesn't do or make anything yet.

Wrapping STL algorithms for use with STL containers

In the algorithm header, most algorithms work on iterator ranges.  Most of the time, I just want the algorithm to work on the whole container.  So, for example, with std::find I'll often find myself typing this:

  1. location = std::find(mycontainer.begin(), mycontainer.end(), somevalue);

I'd much rather write this:

  1. location = std::find(mycontainer, somevalue);

So I started wrapping the STL algorithms to work on containers, like so:

  1. template<class Container, class T>
  2. typename Container::const_iterator find ( const Container & c, const T& value )
  3. {
  4. return std::find(c.begin(), c.end(), value);
  5. }

Nice and easy. I just put that into a namespace called calgo, and then can finally use a simpler syntax!

Standard C++ algorithm and functional headers

I've found joy in the standard C++ algorithm and functional headers. I finally found a nice, neat way to iterate through a container calling a specific function on all elements of the container! I used to do this sort of thing everywhere in my code:

  1. for (std::list <ROADSTRIP>::iterator i = roads.begin(); i != roads.end(); i++)
  2. i->Reverse();

This seems pretty simple, but believe me, it's a lot of typing, especially if the contained type is complicated. Well, instead of doing that, just include algorithm and functional and then do:

  1. std::for_each(roads.begin(), roads.end(), std::mem_fun_ref(&ROADSTRIP::Reverse));

... beautiful.

C++ Reseatable Reference

After reading this article and being inspired, I decided to write a simple "reseatable_reference" class that's sort of like boost::weak_ptr but lighter weight. The idea is that I often use pointers as reseatable references, since in C++ references cannot be reseated. So I created a reseatable_references class that's basically a wrapper around a pointer but nicer to use that putting pointers all through my code along with the baggage they create (initializing them to NULL, asserting that they aren't NULL all over the place, etc). Here's the entire content of the class:
Read the rest of this entry »

Dev Journal and Project Hosting