Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


Fix math in kmVec3RotationToDirection #5

merged 1 commit into from

2 participants


Sorry about that, messed up sin && cos there.
This function is tested.

@Kazade Kazade referenced this pull request from a commit
Commit has since been removed from the repository and is no longer available.
@Kazade Kazade merged commit 3b70f76 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 25, 2012
  1. @Cloudef
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 2 deletions.
  1. +2 −2 kazmath/vec3.c
4 kazmath/vec3.c
@@ -350,8 +350,8 @@ kmVec3* kmVec3RotationToDirection(kmVec3* pOut, const kmVec3* pIn, const kmVec3*
const kmScalar yr = kmDegreesToRadians(pIn->y);
const kmScalar zr = kmDegreesToRadians(pIn->z);
const kmScalar cr = cos(xr), sr = sin(xr);
- const kmScalar cp = cos(yr), sp = cos(yr);
- const kmScalar cy = cos(zr), sy = cos(zr);
+ const kmScalar cp = cos(yr), sp = sin(yr);
+ const kmScalar cy = cos(zr), sy = sin(zr);
const kmScalar srsp = sr*sp;
const kmScalar crsp = cr*sp;
Something went wrong with that request. Please try again.