Skip to main content

SceneCamera3D

Struct SceneCamera3D 

Source
pub struct SceneCamera3D { /* private fields */ }
Expand description

Multi-camera scene registry entry supporting both Perspective and Orthographic Blender/glTF cameras.

Implementations§

Source§

impl SceneCamera3D

Perspective and Orthographic projection matrix builders for SceneCamera3D.

Source

pub fn from_imported( imported: &ImportedCamera3D, node_id: Option<u32>, position: Vec3, rotation: Quat, ) -> Self

Builds a SceneCamera3D from an imported glTF/Blender ImportedCamera3D and node world pose.

§Arguments
  • &ImportedCamera3D - Imported camera parameters.
  • Option<u32> - Optional owning scene-graph node index.
  • Vec3 - World-space camera eye position.
  • Quat - World-space camera orientation quaternion.
§Returns
  • Self - Constructed multi-camera entry.
Source

pub fn forward(&self) -> Vec3

Returns the unit world-space forward direction along glTF local -Z.

§Returns
  • Vec3 - Unit forward vector.
Source

pub fn right(&self) -> Vec3

Returns the unit world-space right direction along glTF local +X.

§Returns
  • Vec3 - Unit right vector.
Source

pub fn up(&self) -> Vec3

Returns the unit world-space up direction along glTF local +Y.

§Returns
  • Vec3 - Unit up vector.
Source

pub fn is_orthographic(&self) -> bool

Returns true when this camera uses orthographic projection.

§Returns
  • bool - Whether projection is orthographic.
Source

pub fn view_projection(&self, viewport_aspect: f32) -> Mat4

Computes the combined projection * view matrix supporting both Perspective and Orthographic projections.

§Arguments
  • &Self - Scene camera reference.
  • f32 - Active viewport aspect ratio width / height.
§Returns
  • Mat4 - Combined view-projection matrix.
Source

pub fn to_camera3d(&self) -> Camera3D

Projects this scene camera to a compatible Camera3D for primary viewport synchronization.

§Returns
  • Camera3D - Equivalent perspective viewport camera descriptor.
Source§

impl SceneCamera3D

Source

pub fn get_name(&self) -> &String

Source

pub fn get_mut_name(&mut self) -> &mut String

Source

pub fn set_name(&mut self, val: String) -> &mut Self

Source

pub fn get_node_id(&self) -> Option<u32>

Source

pub fn try_get_node_id(&self) -> Option<u32>

Source

pub fn get_mut_node_id(&mut self) -> &mut Option<u32>

Source

pub fn set_node_id(&mut self, val: Option<u32>) -> &mut Self

Source

pub fn get_position(&self) -> Vec3

Source

pub fn get_mut_position(&mut self) -> &mut Vec3

Source

pub fn set_position(&mut self, val: Vec3) -> &mut Self

Source

pub fn get_rotation(&self) -> Quat

Source

pub fn get_mut_rotation(&mut self) -> &mut Quat

Source

pub fn set_rotation(&mut self, val: Quat) -> &mut Self

Source

pub fn get_projection(&self) -> GltfCameraProjection

Source

pub fn get_mut_projection(&mut self) -> &mut GltfCameraProjection

Source

pub fn set_projection(&mut self, val: GltfCameraProjection) -> &mut Self

Trait Implementations§

Source§

impl Clone for SceneCamera3D

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SceneCamera3D

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for SceneCamera3D

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for SceneCamera3D

Auto Trait Implementations§

§

impl Forget for SceneCamera3D

§

impl Freeze for SceneCamera3D
where *const u8 is !null: Freeze, PhantomData<u8>: Freeze,

§

impl Move for SceneCamera3D

§

impl RefUnwindSafe for SceneCamera3D

§

impl Send for SceneCamera3D
where RawVecInner: Send,

§

impl Sync for SceneCamera3D
where RawVecInner: Sync,

§

impl Unpin for SceneCamera3D
where *const u8 is !null: Unpin,

§

impl UnsafeUnpin for SceneCamera3D

§

impl UnwindSafe for SceneCamera3D
where RawVecInner: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.