This project is read-only.

TSM - A TypeScript vector and matrix math library

Topics: General
Oct 20, 2012 at 6:25 PM
Edited Oct 20, 2012 at 6:25 PM

TSM on GitHub

TSM is a a collection of vector and matrix classes. I have written these classes as part of a game engine that I have been working on for almost four years now and that I plan to release very soon as well.

The library's design is influenced by both gl-matrix and GLM. For example, TSM makes use of JavaScript's new property definitions to enable GLSL-style element access:

var v = new TSM.vec3();
var q = new TSM.quat();
v.xy = [0, 1]; q.w = 1.0;

Also, it offers both non-static and static methods for many operations:

var v1 = new TSM.vec3([1, 2, 3]);
var v2 = new TSM.vec3([4, 5, 6]);
var v3 = TSM.vec3.sum(v1, v2);
var v4 = v1.copy().add(v2);
console.log(v3.equals(v4)) // output: "true"

I hope this library proves to be helpful to some of you.

This is my first GitHub project and also the first time I release code of my own as open source, so if I forgot important details (project organization, licensing, etc.), please let me know.