Camera
struct · ferroui-media3d · v0.5.0
struct Camera
WPF's Camera: the base of the cameras, with a Transform that places the camera in the
world.
Members
TYPEto_refget_view_matrixget_projection_matrixtransform_propertyconstructtransformset_transformchangedworld_position
TYPE
const TYPE: &'static $crate::TypeInfo
The runtime type of this class.
to_ref
fn to_ref(self: &Self) -> $crate::Ref<Camera>
Returns a strong reference to this object.
get_view_matrix
fn get_view_matrix(self: &Self) -> Matrix3D
The matrix from the world to the coordinates of the camera, its transform included
(WPF's GetViewMatrix). Not finite when the transform has no inverse: the camera
then shows nothing.
get_projection_matrix
fn get_projection_matrix(self: &Self, aspect_ratio: f64, near_plane_distance: f64, far_plane_distance: f64) -> Matrix3D
The matrix from the coordinates of the camera to the clip space for the aspect ratio
(width over height) and the near and far planes (WPF's GetProjectionMatrix, with
the planes given, as the snapshot fits them to the scene). A matrix camera ignores
the planes.
transform_property
fn transform_property() -> &'static StyledProperty<Option<Ref<Transform3D>>>
construct
fn construct() -> Self
Creates the class data; see ferroui_base::FerroObject::construct.
transform
fn transform(self: &Self) -> Option<Ref<Transform3D>>
The transform that places the camera in the world; none is the identity.
set_transform
fn set_transform(self: &Self, value: Option<Ref<Transform3D>>)
changed
fn changed(self: &Self, handler: impl Fn(Scene3DChange) -> () + 'static) -> Subscription
Calls handler on every change of the camera, until the returned guard is dropped.
world_position
fn world_position(self: &Self) -> Option<Point3D>
The position of the camera in the world: the origin of its coordinates.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeCameraImplExtBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>ReceiverAnyFerroObjectImplExtClassDefaultsErasedDestructorIntoEitherDerefUpcast<T>Upcast<Camera>StaticTypeObjectTypeSubclassable<T>FerroObjectImplCameraImpl
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.