Wednesday 14 December 2011

Math, Can't Outrun It

So my next big push is going to involve, adding a new function clone() to gladius.math to allow for cloning of matrices without incurring a new allocation. New branch created for this:  https://github.com/saecob/gladius.math/tree/alpha

Simple enough with a source and destination parameter, copy one into the other.  The next step is to bring transform.js in line with the api.  The difficulty now is understanding the linear algebra used.
  • Scale()
  • Rotate()
  • Translate()
Coming up with some clever tests and resources for this bit of code will be part of the challenge.

After getting things sorted out with transform, one last pass over the unit tests to add some variety will need to be done.  After this maybe it will be time to take a look at our Algorithm scripts.

Monday 12 December 2011

Progress Central

Today after my exam i decided to knock out a bunch of implementations for Gladius.Math.  We now have a 90% complete implementation of the new API and its exciting. Check it out here: https://github.com/saecob/gladius.math

The main work was done to Matrices of the 3x3 and 4x4 variety and of course the ever loved test scripts to go along with them.  The biggest change to get used to is definitely the addition of matrix lists as parameters for almost all of the matrix implementations.

Because of this, i decided to iterate through the matrix list in each respective function and call the base Matrix class to complete the additions.  This looping system may have a pretty big impact on performance for long lists of matrices but for now it seems to be working fine.

Along the way while updating Matrix4, i managed to break the transform methods as they were relying on the old method calls to multiply.  A simple fix but it will go in along with my next big update.  All i would need to do is to add the 2 matrices being multiplied to a list and pass that parameter.

The next big update will include Quaternion and Transform method implementations and tests, along with some way to allow a developer to clone a matrix/vector without incurring a new allocation.

Thursday 1 December 2011

End In Sight

So the end of the school term is fast approaching and I am definitely feeling the crunch.  I pushed up a new commit to my Github account (https://github.com/saecob/gladius.math/tree/develop) under the develop branch in preparation for a major pull request for implementations of all Matrix functions.

Everything seems to be working fine, except for inverse().

Not exactly sure what is wrong yet but i think i may have missed a movement of some sort with the matrix indexes.  Ill take a look at it during the day today.

Next up: Matrix3 and finally Matrix4 which already has implementations but needs to be brought in line with the API.
Also, I need to change some of the tests for Matrix as the API now states that our functions should accept an array of Matrices which is not being tested as of yet.

Check back tonight.