MCPcopy
hub / github.com/g3n/engine / ApplyToVector3Array

Method ApplyToVector3Array

math32/matrix3.go:121–135  ·  view source on GitHub ↗

ApplyToVector3Array multiplies length vectors in the array starting at offset by this matrix. Returns pointer to the updated array. This matrix is unchanged.

(array []float32, offset int, length int)

Source from the content-addressed store, hash-verified

119// Returns pointer to the updated array.
120// This matrix is unchanged.
121func (m *Matrix3) ApplyToVector3Array(array []float32, offset int, length int) []float32 {
122
123 var v1 Vector3
124 j := offset
125 for i := 0; i < length; i += 3 {
126 v1.X = array[j]
127 v1.Y = array[j+1]
128 v1.Z = array[j+2]
129 v1.ApplyMatrix3(m)
130 array[j] = v1.X
131 array[j+1] = v1.Y
132 array[j+2] = v1.Z
133 }
134 return array
135}
136
137// Multiply multiply this matrix by the other matrix
138// Returns pointer to this updated matrix.

Callers

nothing calls this directly

Calls 1

ApplyMatrix3Method · 0.95

Tested by

no test coverage detected