Project transforms the specified position from world coordinates to this camera projected coordinates.
(v *math32.Vector3)
| 276 | |
| 277 | // Project transforms the specified position from world coordinates to this camera projected coordinates. |
| 278 | func (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. |
| 291 | func (c *Camera) Unproject(v *math32.Vector3) *math32.Vector3 { |
nothing calls this directly
no test coverage detected