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

Method Project

camera/camera.go:278–288  ·  view source on GitHub ↗

Project transforms the specified position from world coordinates to this camera projected coordinates.

(v *math32.Vector3)

Source from the content-addressed store, hash-verified

276
277// Project transforms the specified position from world coordinates to this camera projected coordinates.
278func (c *Camera) Project(v *math32.Vector3) *math32.Vector3 {
279
280 // Get camera view matrix
281 var viewMat, projMat math32.Matrix4
282 c.ViewMatrix(&viewMat)
283 c.ProjMatrix(&projMat)
284
285 // Apply projMat * viewMat to the provided vector
286 v.ApplyProjection(projMat.Multiply(&viewMat))
287 return v
288}
289
290// Unproject transforms the specified position from camera projected coordinates to world coordinates.
291func (c *Camera) Unproject(v *math32.Vector3) *math32.Vector3 {

Callers

nothing calls this directly

Calls 4

ViewMatrixMethod · 0.95
ProjMatrixMethod · 0.95
MultiplyMethod · 0.95
ApplyProjectionMethod · 0.80

Tested by

no test coverage detected