Camera represents a virtual camera, which specifies how to project a 3D scene onto an image.
| 40 | |
| 41 | // Camera represents a virtual camera, which specifies how to project a 3D scene onto an image. |
| 42 | type Camera struct { |
| 43 | core.Node // Embedded Node |
| 44 | aspect float32 // Aspect ratio (width/height) |
| 45 | near float32 // Near plane depth |
| 46 | far float32 // Far plane depth |
| 47 | axis Axis // The reference axis |
| 48 | proj Projection // Projection method |
| 49 | fov float32 // Perspective field-of-view along reference axis |
| 50 | size float32 // Orthographic size along reference axis |
| 51 | projChanged bool // Flag indicating that the projection matrix needs to be recalculated |
| 52 | projMatrix math32.Matrix4 // Last calculated projection matrix |
| 53 | } |
| 54 | |
| 55 | // New creates and returns a new perspective camera with the specified aspect ratio and default parameters. |
| 56 | func New(aspect float32) *Camera { |
nothing calls this directly
no outgoing calls
no test coverage detected