Crate bevy_blendy_cameras

Source
Expand description

Camera Controllers and tools for editor like 3D views

Inspired by Blender’s viewport camera controls and tools and provide the same functionalities:

  • Pan/Orbit/Zoom camera controls with “Zoom to mouse position” and “Auto depth”.
  • Fly camera controls with zooming (back, forward), panning (left, right, down, up) and speed controls.
  • Set viewpoint: View from left, right, front, back, top and bottom.
  • Frame entities into view: Allowing to do things like framing the whole scene, or the selected objects.
  • Switch between orthographic and perspective camera projection

Modules§

raycast
Raycast utilities

Structs§

ActiveCameraData
Tracks which PanOrbitCamera is active (should handle input events), along with the window and viewport dimensions, which are used for scaling mouse motion. BlendyCamerasPlugin manages this resource automatically, in order to support multiple viewports/windows. However, if this doesn’t work for you, you can take over and manage it yourself, e.g. when you want to control a camera that is rendering to a texture.
BlendyCamerasPlugin
Bevy pluging that contains all the systems necessarty to this crate
FlyCameraController
Component to tag an entiy as able to be controlled in “fly mode” The entity must have Transform and Projection components. Typically you would add Camera3d to this entity.
FrameEvent
Event to move the camera to frame certain entities
OrbitCameraController
Component to tag an entiy as able to be controlled by orbiting, panning and zooming. The entity must have Transform and Projection components. Typically you would add Camera3d to this entity.
SwitchProjection
Event to switch between perspective and ortographic camera projections
SwitchToFlyController
Event to enable the FlyCameraController and disable the OrbitCameraController if present
SwitchToOrbitController
Event to enable the OrbitCameraController and disable the FlyCameraController if present
ViewpointEvent
Event used to set the camera point of view

Enums§

BlendyCamerasSystemSet
System set to allow ordering
Viewpoint
Point of view of a camera, looking in the oposite direction

Functions§

get_camera_entity_from_cursor_position
Get the camera entity that renders to the viewport under the mouse cursor with highest rendering order.