Merge pull request #110 from ZeronSix/scale
Added Matrix3::from_diagonal
This commit is contained in:
commit
5c07e8a421
1 changed files with 7 additions and 0 deletions
|
@ -208,6 +208,13 @@ Matrix3<S> {
|
|||
_1subc * axis.y * axis.z - s * axis.x,
|
||||
_1subc * axis.z * axis.z + c)
|
||||
}
|
||||
|
||||
/// Create a matrix from a non-uniform scale
|
||||
pub fn from_diagonal(value: &Vector3<S>) -> Matrix3<S> {
|
||||
Matrix3::new(value.x, zero(), zero(),
|
||||
zero(), value.y, zero(),
|
||||
zero(), zero(), value.z)
|
||||
}
|
||||
}
|
||||
|
||||
impl<S: BaseNum> Matrix4<S> {
|
||||
|
|
Loading…
Reference in a new issue