Boost logo

Boost :

From: Jason Hise (chaos_at_[hidden])
Date: 2006-03-24 01:12:16


If anyone is interested, I have already completed a library for the math
that a geometry library would require for my game engine. It supports
the following types, along with all of the most commonly used operations
that they should naturally support:

vector<Type, Dim>;
matrix<Type, Rows, Columns>;
quaternion<Type>;

Implementing quaternions generically required the development of generic
algorithms to compute sine and cosine, which I have also completed and
tested.

To access elements of a vector one uses the [] operator with a numeric
index. 0-3 have the aliases _x, _y, _z, and _w, so one could do the
following:

vector<float, 4> v;
v[_x] = 42;
v[_y] = -13;
v[_z] = 3.14f;
v[_w] = 1;

Matrix multiplication, being templated, allows attempted multiplication
of incompatible matrices to be detected as a compile time error.

The code has been uploaded to the boost vault
(http://boost-consulting.com/vault, geometry_math.zip). It is not in
the form of a boost library per say (it uses my engine's namespace
instead of the boost namespace), but if there is interest I would be
willing to do the conversion and donate it to the project. I
additionally would be willing to donate any relevant code that I used in
implementing my software rasterizer which was built on this (for example
functions to generate transformation matrices, including projections, or
functions for working with colors, etc...)

-Jason Hise


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk