Expand description
Little engine camera abstraction
Introduces a new position type: WorldPosition
, which contains
coordinates in f64 values. This allows little-bevy to model vast
spaces, up to an entire solar system at millimetre precision.
§How to use
The main product of little-camera
is the VirtualCameraBundle
,
which defines a virtual camera in space, with additional settings
(zoom, apeture size, exposure time, and ISO). A VirtualCamera
can be marked as Active
, which switches the rendered camera to
that location and settings.
little-camera
exposes a utility function init_base_camera()
,
which spawns a correctly tagged 2D camera. Alternatively, you can
spawn your own camera, as long as it is tagged with the
LittleCamera
component.
The translate
module is vital for translating different
posititional systems to one-another.
-
Points from cursor positions and screen locations can be translated into render coordinates for indicator rendering, and world coordinates, for collision detection.
-
Points in world space can be translated into render coordinates, to place them at the correct location for the base camera.
§Future ideas
-
Integrated camera-sharing capabilities, allowing players or different sessions to share camera views. Having a template to express camera locations and setting also allows for scripted camera transitions and cutscenes.
-
WorldPositionStack
, which allows a range of possible WorldPositions, become the new base scalar value for another layer ofWorldPosition
. This way vast quantities of space can be modelled.
Modules§
Structs§
- Base
Camera Apeture - Base
Camera Exposure Ms - Base
CameraISO - Initial
Base Camera Scale - Little
Camera - VCamera
Scale - Camera scaling
- VCamera
State Active - VCamera
State Dead - VCamera
State Idle - VCamera
State Stored - Velocity
- Viewport
Bundle - Virtual
Camera - Represent a virtual camera space
- Virtual
Camera Bundle - World
Position