Camera - Wantcha/Chimera GitHub Wiki
Camera Component
CameraComponent is a variable type controlling the parameters of a Camera. It can be retrieved from an entity using the GetCameraComponent() function.
- bool CameraComponent.primary
Property controlling whether this camera is primary or not.
- bool CameraComponent.fixedAspectRatio
Property controlling whether this camera has a fixed aspect ratio or not.
- float CameraComponent.fov
The field of view of the camera.
- float CameraComponent.orthoSize
The size of the orthographic camera.
- float CameraComponent.orthoNear
The distance to the near clip plane of the orthographic camera.
- float CameraComponent.orthoFar
The distance to the far clip plane of the orthographic camera.
- float CameraComponent.perspectiveNear
The distance to the near clip plane of the perspective camera.
- float CameraComponent.perspectiveFar
The distance to the far clip plane of the perspective camera.
- void CameraComponent:SetOrthographic()
Changes the projection type of the camera to orthographic.
- void CameraComponent:SetPerspective()
Changes the projection type of the camera to perspective.
- float CameraComponent:GetWidth()
Returns the width of the camera in pixels.
- float CameraComponent:GetHeight()
Returns the height of the camera in pixels.
- Vector3 CameraComponent:ScreenToWorld(Vector2 position, Matrix4 cameraTransform)
Returns the conversion of a given 2D screen position into its corresponding position in world space (with a Z value of 0).