Skip to content

Instantly share code, notes, and snippets.

@Gankra
Created October 16, 2014 14:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Gankra/45db3e3bd0007cb0d37d to your computer and use it in GitHub Desktop.
Save Gankra/45db3e3bd0007cb0d37d to your computer and use it in GitHub Desktop.
// set the matrix as a yaw rotation matrix
// if degree is true (!=0) then angle is given in degrees
// otherwise angle is given in radians
static Matrix4f rotateY(float angle, int degree);
// Editor's note: THIS LIBRARY IS SUPPOSED TO BE FOR OPENGL WHAT
Matrix4f * getViewMatrix(D3DXMATRIX * viewMatrix);
// Editor's note: Vectors are never a reasonable thing to pass by raw ptr
int changeAbsPosition(Vector3f *v);
// change the speed of the camera motion
int camera::updateSpeed(float speed)
{
this->speed += speed;
return 0; // Editor's note: every single function apparently has to return a uint explicitly, no matter how useless
}
class Matrix4f
{
public:
// Editor's note: Yes, this matrix class contains two *completely different* representations of the same data
// Some methods use one, and some use the other. Completely inscrutable. Neither of these can actually be *given*
// to the OpenGL API directly, which expects a flat array.
float *m[4]; // can be removed (Editor's note: cannot actually be removed)
Vector4f vm[4];
// ... methods and stuff
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment