on master help sign in
Move docs around a bit
f4a6b3eEvan Czaplicki
libraries/Math/Matrix4.elm+17−11
@@ -7,19 +7,25 @@ This library uses the convention that the prefix `make` is creating a new
7array, whereas without the prefix, you are applying some transform to an
7array, whereas without the prefix, you are applying some transform to an
8existing matrix.
8existing matrix.
9
9
10−@docs mul4x4
10+# Create
11+
12+@docs identity
11
13
12# Operations
14# Operations
13
15
14−@docs identity, inverseOrthonormal, mul, mulAffine, transpose, makeBasis
16+@docs inverseOrthonormal, mul, mulAffine, mulVec3, transpose, makeBasis
15
17
16# Projections
18# Projections
17
19
18@docs makeFrustrum, makePerspective, makeOrtho, makeOrtho2D, makeLookAt
20@docs makeFrustrum, makePerspective, makeOrtho, makeOrtho2D, makeLookAt
19
21
20−# Transforms
22+# Apply Transformations
23+
24+@docs rotate, scale, scale3, translate, translate3
25+
26+# Create Transformations
21
27
22−@docs makeRotate, rotate, makeScale3, makeScale, scaleM3, scaleM, makeTranslate3, makeTranslate, translate3, translate
28+@docs makeRotate, makeScale, makeScale3, makeTranslate, makeTranslate3
23
29
24-}
30-}
25
31
@@ -30,8 +36,8 @@ data Mat4 = Mat4
30
36
31{-| Multiply a vector by a 4x4 matrix: m * v
37{-| Multiply a vector by a 4x4 matrix: m * v
32-}
38-}
33−mul4x4 : Mat4 -> Vec3 -> Vec3
39+mulVec3 : Mat4 -> Vec3 -> Vec3
34−mul4x4 = Native.MJS.v3mul4x4
40+mulVec3 = Native.MJS.v3mul4x4
35
41
36{-| A matrix with all 0s, except 1s on the diagonal.
42{-| A matrix with all 0s, except 1s on the diagonal.
37-}
43-}
@@ -114,7 +120,7 @@ mulAffine = Native.MJS.m4x4mulAffine
114makeRotate : Float -> Vec3 -> Mat4
120makeRotate : Float -> Vec3 -> Mat4
115makeRotate = Native.MJS.m4x4makeRotate
121makeRotate = Native.MJS.m4x4makeRotate
116
122
117−{-| Concatenates a rotation of angle radians about the axis to the given matrix.
123+{-| Concatenates a rotation in radians about an axis to the given matrix.
118-}
124-}
119rotate : Float -> Vec3 -> Mat4 -> Mat4
125rotate : Float -> Vec3 -> Mat4 -> Mat4
120rotate = Native.MJS.m4x4rotate
126rotate = Native.MJS.m4x4rotate
@@ -133,13 +139,13 @@ makeScale = Native.MJS.m4x4makeScale
133
139
134{-| Concatenates a scaling to the given matrix.
140{-| Concatenates a scaling to the given matrix.
135-}
141-}
136−scaleM3 : Float -> Float -> Float -> Mat4 -> Mat4
142+scale3 : Float -> Float -> Float -> Mat4 -> Mat4
137−scaleM3 = Native.MJS.m4x4scale3
143+scale3 = Native.MJS.m4x4scale3
138
144
139{-| Concatenates a scaling to the given matrix.
145{-| Concatenates a scaling to the given matrix.
140-}
146-}
141−scaleM : Vec3 -> Mat4 -> Mat4
147+scale : Vec3 -> Mat4 -> Mat4
142−scaleM = Native.MJS.m4x4scale
148+scale = Native.MJS.m4x4scale
143
149
144{-|
150{-|
145Creates a transformation matrix for translating by 3 scalar values, one for
151Creates a transformation matrix for translating by 3 scalar values, one for