MCPcopy Index your code
hub / github.com/EngoEngine/engo / Translate

Method Translate

math.go:199–214  ·  view source on GitHub ↗

Translate translates m by the point (x, y).

(x, y float32)

Source from the content-addressed store, hash-verified

197
198// Translate translates m by the point (x, y).
199func (m *Matrix) Translate(x, y float32) *Matrix {
200 m.tmp[m00] = 1
201 m.tmp[m10] = 0
202 m.tmp[m20] = 0
203
204 m.tmp[m01] = 0
205 m.tmp[m11] = 1
206 m.tmp[m21] = 0
207
208 m.tmp[m02] = x
209 m.tmp[m12] = y
210 m.tmp[m22] = 1
211
212 multiplyMatricies(m.Val[:], m.tmp[:])
213 return m
214}
215
216// TranslatePoint translates m by the point p.
217func (m *Matrix) TranslatePoint(p Point) *Matrix {

Callers 8

TranslatePointMethod · 0.95
TestMatrixTranslateFunction · 0.80
PrepareCullingMethod · 0.80
makeModelMatrixMethod · 0.80
SetCameraMethod · 0.80
PrepareCullingMethod · 0.80
makeModelMatrixMethod · 0.80
SetCameraMethod · 0.80

Calls 1

multiplyMatriciesFunction · 0.85

Tested by 1

TestMatrixTranslateFunction · 0.64