pub struct Camera3D {
pub fov_y_degrees: f32,
pub near: f32,
pub far: f32,
pub view_matrix: [[f32; 4]; 4],
pub position: [f32; 3],
pub yaw: f32,
pub pitch: f32,
pub desired_move: [f32; 3],
pub jump_requested: bool,
pub interact_requested: bool,
pub controller: Option<CameraController>,
}Expand description
Declares the 3D camera. One per scene.
Fields§
§fov_y_degrees: f32Vertical field of view in degrees.
near: f32Near clip distance in world units.
far: f32Far clip distance in world units.
view_matrix: [[f32; 4]; 4]Current view matrix, written each step by the active camera system. Column-major, matching the GLSL mat4 convention.
position: [f32; 3]Current world-space eye position, kept in sync with view_matrix.
yaw: f32Current yaw in radians.
pitch: f32Current pitch in radians.
desired_move: [f32; 3]World-space horizontal movement intent (units/second). Written by Camera3DSystem each frame, consumed by PhysicsSystem. Runtime-only.
jump_requested: boolSet for one frame when the jump key is pressed. Runtime-only.
interact_requested: boolSet for one frame when the interact key is pressed. Runtime-only.
controller: Option<CameraController>Controller settings, or None for an uncontrolled (cutscene) camera.
Read once by the internal camera controller at init.
Implementations§
Trait Implementations§
Source§impl Component for Camera3D
impl Component for Camera3D
Source§fn from_baked(bytes: &[u8]) -> Result<Self, CnResult>
fn from_baked(bytes: &[u8]) -> Result<Self, CnResult>
Reconstruct this component from a blob record, whose bytes are the
serialized runtime component (cook already ran the asset -> component
translation). The default rejects: runtime-only components are never
stored in a blob, so only loadable types provide an implementation.
Source§fn inject_locator(&mut self, _locator: PayloadLocator)
fn inject_locator(&mut self, _locator: PayloadLocator)
Called after construction to inject the payload locator from the blob def.
Only meaningful for components with a compiled payload.
The default implementation does nothing (correct for most components).
Source§fn inject_name(&mut self, _id: AssetId)
fn inject_name(&mut self, _id: AssetId)
Called after construction to inject the asset’s identity from the blob
def. Only meaningful for components that look themselves up by id at
runtime. The default implementation does nothing.
Source§impl ComponentSlot for Camera3D
impl ComponentSlot for Camera3D
Source§const DISCRIMINANT: u8
const DISCRIMINANT: u8
The component type’s stable id, used as its
ComponentId.Source§fn slot(s: &ComponentStorage) -> &Column<Self>
fn slot(s: &ComponentStorage) -> &Column<Self>
Borrow this type’s column out of the storage.
Source§fn slot_mut(s: &mut ComponentStorage) -> &mut Column<Self>
fn slot_mut(s: &mut ComponentStorage) -> &mut Column<Self>
Mutably borrow this type’s column out of the storage.
Source§impl<'de> Deserialize<'de> for Camera3D
impl<'de> Deserialize<'de> for Camera3D
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<Camera3D> for ComponentAsset
impl From<Camera3D> for ComponentAsset
impl RuntimeComponent for Camera3D
Auto Trait Implementations§
impl Freeze for Camera3D
impl RefUnwindSafe for Camera3D
impl Send for Camera3D
impl Sync for Camera3D
impl Unpin for Camera3D
impl UnsafeUnpin for Camera3D
impl UnwindSafe for Camera3D
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more