|
@@ -753,3 +753,23 @@ func (m *Matrix4) Clone() *Matrix4 {
|
|
|
cloned = *m
|
|
cloned = *m
|
|
|
return &cloned
|
|
return &cloned
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+// GetColumn returns the ith column.
|
|
|
|
|
+func (m *Matrix4) GetColumn(i int) *Vector4 {
|
|
|
|
|
+ return NewVector4(m[i*4], m[i*4+1], m[i*4+2], m[i*4+3])
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+// GetRow returns the ith row.
|
|
|
|
|
+func (m *Matrix4) GetRow(i int) *Vector4 {
|
|
|
|
|
+ return NewVector4(m[i], m[i*4], m[i+8], m[i+12])
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+// GetColumn returns the ith column.
|
|
|
|
|
+func (m *Matrix4) GetColumnVector3(i int) *Vector3 {
|
|
|
|
|
+ return NewVector3(m[i*4], m[i*4+1], m[i*4+2])
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+// GetRow returns the ith row.
|
|
|
|
|
+func (m *Matrix4) GetRowVector3(i int) *Vector3 {
|
|
|
|
|
+ return NewVector3(m[i], m[i*4], m[i+8])
|
|
|
|
|
+}
|