Struct CameraApi

Source
#[repr(C)]
pub struct CameraApi {
Show 17 fields pub view_from_transform: Option<unsafe extern "C" fn(view: *mut Mat44T, tm: *const TransformT) -> *mut Mat44T>, pub view_from_lookin: Option<unsafe extern "C" fn(view: *mut Mat44T, position: Vec3T, forward: Vec3T, up: Vec3T) -> *mut Mat44T>, pub transform_from_view: Option<unsafe extern "C" fn(tm: *mut TransformT, view: *const Mat44T) -> *mut TransformT>, pub projection_from_frustum: Option<unsafe extern "C" fn(proj: *mut Mat44T, left: f32, right: f32, bottom: f32, top: f32, near: f32, far: f32) -> *mut Mat44T>, pub matrices_from_eyes: Option<unsafe extern "C" fn(camera: *mut CameraT, head_tm: *const Mat44T, head_to_left_eye: *const Mat44T, head_to_right_eye: *const Mat44T, left_eye_left: f32, left_eye_right: f32, left_eye_top: f32, left_eye_bottom: f32, right_eye_left: f32, right_eye_right: f32, right_eye_top: f32, right_eye_bottom: f32)>, pub projection_from_fov: Option<unsafe extern "C" fn(proj: *mut Mat44T, near_plane: f32, far_plane: f32, vertical_fov: f32, aspect: f32) -> *mut Mat44T>, pub orthographic_from_frustum: Option<unsafe extern "C" fn(proj: *mut Mat44T, left: f32, right: f32, bottom: f32, top: f32, near: f32, far: f32) -> *mut Mat44T>, pub orthographics_from_dimensions: Option<unsafe extern "C" fn(proj: *mut Mat44T, near_plane: f32, far_plane: f32, width: f32, height: f32) -> *mut Mat44T>, pub projection_from_camera: Option<unsafe extern "C" fn(camera: *mut CameraT, transform: CameraTransform, aspect: f32) -> *mut Mat44T>, pub update_free_flight: Option<unsafe extern "C" fn(tm: *mut TransformT, t: Vec3T, r: Vec2T)>, pub update_pan: Option<unsafe extern "C" fn(tm: *mut TransformT, focus_position: *mut Vec3T, pan: Vec2T)>, pub update_maya: Option<unsafe extern "C" fn(tm: *mut TransformT, focus_position: Vec3T, zoom: f32, rot: Vec2T)>, pub world_to_screen: Option<unsafe extern "C" fn(camera: *const CameraT, transform: CameraTransform, viewport: RectT, world: *const Vec3T, screen: *mut Vec3T, n: u32) -> *mut Vec3T>, pub screen_to_world: Option<unsafe extern "C" fn(camera: *const CameraT, transform: CameraTransform, viewport: RectT, screen: *const Vec3T, world: *mut Vec3T, n: u32) -> *mut Vec3T>, pub meters_per_pixel: Option<unsafe extern "C" fn(distance: f32, vertical_fov: f32, viewport_height: f32) -> f32>, pub default_camera_settings: Option<unsafe extern "C" fn() -> *const CameraSettingsT>, pub frustum_planes_from_view_projection: Option<unsafe extern "C" fn(view: *const Mat44T, projection: *const Mat44T, frustum_planes: *mut Vec4T)>,
}

Fields§

§view_from_transform: Option<unsafe extern "C" fn(view: *mut Mat44T, tm: *const TransformT) -> *mut Mat44T>§view_from_lookin: Option<unsafe extern "C" fn(view: *mut Mat44T, position: Vec3T, forward: Vec3T, up: Vec3T) -> *mut Mat44T>§transform_from_view: Option<unsafe extern "C" fn(tm: *mut TransformT, view: *const Mat44T) -> *mut TransformT>§projection_from_frustum: Option<unsafe extern "C" fn(proj: *mut Mat44T, left: f32, right: f32, bottom: f32, top: f32, near: f32, far: f32) -> *mut Mat44T>§matrices_from_eyes: Option<unsafe extern "C" fn(camera: *mut CameraT, head_tm: *const Mat44T, head_to_left_eye: *const Mat44T, head_to_right_eye: *const Mat44T, left_eye_left: f32, left_eye_right: f32, left_eye_top: f32, left_eye_bottom: f32, right_eye_left: f32, right_eye_right: f32, right_eye_top: f32, right_eye_bottom: f32)>§projection_from_fov: Option<unsafe extern "C" fn(proj: *mut Mat44T, near_plane: f32, far_plane: f32, vertical_fov: f32, aspect: f32) -> *mut Mat44T>§orthographic_from_frustum: Option<unsafe extern "C" fn(proj: *mut Mat44T, left: f32, right: f32, bottom: f32, top: f32, near: f32, far: f32) -> *mut Mat44T>§orthographics_from_dimensions: Option<unsafe extern "C" fn(proj: *mut Mat44T, near_plane: f32, far_plane: f32, width: f32, height: f32) -> *mut Mat44T>§projection_from_camera: Option<unsafe extern "C" fn(camera: *mut CameraT, transform: CameraTransform, aspect: f32) -> *mut Mat44T>§update_free_flight: Option<unsafe extern "C" fn(tm: *mut TransformT, t: Vec3T, r: Vec2T)>§update_pan: Option<unsafe extern "C" fn(tm: *mut TransformT, focus_position: *mut Vec3T, pan: Vec2T)>§update_maya: Option<unsafe extern "C" fn(tm: *mut TransformT, focus_position: Vec3T, zoom: f32, rot: Vec2T)>§world_to_screen: Option<unsafe extern "C" fn(camera: *const CameraT, transform: CameraTransform, viewport: RectT, world: *const Vec3T, screen: *mut Vec3T, n: u32) -> *mut Vec3T>§screen_to_world: Option<unsafe extern "C" fn(camera: *const CameraT, transform: CameraTransform, viewport: RectT, screen: *const Vec3T, world: *mut Vec3T, n: u32) -> *mut Vec3T>§meters_per_pixel: Option<unsafe extern "C" fn(distance: f32, vertical_fov: f32, viewport_height: f32) -> f32>§default_camera_settings: Option<unsafe extern "C" fn() -> *const CameraSettingsT>§frustum_planes_from_view_projection: Option<unsafe extern "C" fn(view: *const Mat44T, projection: *const Mat44T, frustum_planes: *mut Vec4T)>

Implementations§

Source§

impl CameraApi

Source

pub unsafe fn view_from_transform( &self, view: *mut Mat44T, tm: *const TransformT, ) -> *mut Mat44T

Source

pub unsafe fn view_from_lookin( &self, view: *mut Mat44T, position: Vec3T, forward: Vec3T, up: Vec3T, ) -> *mut Mat44T

Source

pub unsafe fn transform_from_view( &self, tm: *mut TransformT, view: *const Mat44T, ) -> *mut TransformT

Source

pub unsafe fn projection_from_frustum( &self, proj: *mut Mat44T, left: f32, right: f32, bottom: f32, top: f32, near: f32, far: f32, ) -> *mut Mat44T

Source

pub unsafe fn matrices_from_eyes( &self, camera: *mut CameraT, head_tm: *const Mat44T, head_to_left_eye: *const Mat44T, head_to_right_eye: *const Mat44T, left_eye_left: f32, left_eye_right: f32, left_eye_top: f32, left_eye_bottom: f32, right_eye_left: f32, right_eye_right: f32, right_eye_top: f32, right_eye_bottom: f32, )

Source

pub unsafe fn projection_from_fov( &self, proj: *mut Mat44T, near_plane: f32, far_plane: f32, vertical_fov: f32, aspect: f32, ) -> *mut Mat44T

Source

pub unsafe fn orthographic_from_frustum( &self, proj: *mut Mat44T, left: f32, right: f32, bottom: f32, top: f32, near: f32, far: f32, ) -> *mut Mat44T

Source

pub unsafe fn orthographics_from_dimensions( &self, proj: *mut Mat44T, near_plane: f32, far_plane: f32, width: f32, height: f32, ) -> *mut Mat44T

Source

pub unsafe fn projection_from_camera( &self, camera: *mut CameraT, transform: CameraTransform, aspect: f32, ) -> *mut Mat44T

Source

pub unsafe fn update_free_flight(&self, tm: *mut TransformT, t: Vec3T, r: Vec2T)

Source

pub unsafe fn update_pan( &self, tm: *mut TransformT, focus_position: *mut Vec3T, pan: Vec2T, )

Source

pub unsafe fn update_maya( &self, tm: *mut TransformT, focus_position: Vec3T, zoom: f32, rot: Vec2T, )

Source

pub unsafe fn world_to_screen( &self, camera: *const CameraT, transform: CameraTransform, viewport: RectT, world: *const Vec3T, screen: *mut Vec3T, n: u32, ) -> *mut Vec3T

Source

pub unsafe fn screen_to_world( &self, camera: *const CameraT, transform: CameraTransform, viewport: RectT, screen: *const Vec3T, world: *mut Vec3T, n: u32, ) -> *mut Vec3T

Source

pub unsafe fn meters_per_pixel( &self, distance: f32, vertical_fov: f32, viewport_height: f32, ) -> f32

Source

pub unsafe fn default_camera_settings(&self) -> *const CameraSettingsT

Source

pub unsafe fn frustum_planes_from_view_projection( &self, view: *const Mat44T, projection: *const Mat44T, frustum_planes: *mut Vec4T, )

Trait Implementations§

Source§

impl Api for CameraApi

Source§

impl Clone for CameraApi

Source§

fn clone(&self) -> CameraApi

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Default for CameraApi

Source§

fn default() -> CameraApi

Returns the “default value” for a type. Read more
Source§

impl Copy for CameraApi

Auto Trait Implementations§

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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.