Added scale to Matrix4f

This commit is contained in:
Elias Naur 2003-04-28 12:10:54 +00:00
parent 81dc347de0
commit 56e8d511bd
1 changed files with 21 additions and 0 deletions

View File

@ -464,6 +464,27 @@ public class Matrix4f extends Matrix {
return this; return this;
} }
/**
* Scales this matrix
* @param vec The vector to scale by
* @return this
*/
public Matrix4f scale(Vector3f vec) {
m00 *= vec.x;
m01 *= vec.x;
m02 *= vec.x;
m03 *= vec.x;
m10 *= vec.y;
m11 *= vec.y;
m12 *= vec.y;
m13 *= vec.y;
m20 *= vec.z;
m21 *= vec.z;
m22 *= vec.z;
m23 *= vec.z;
return this;
}
/** /**
* Rotates the matrix around the given axis the specified angle * Rotates the matrix around the given axis the specified angle
* @param angle the angle, in degrees. * @param angle the angle, in degrees.