#[doc(alias = "webgl")]
pub mod opengl {
use crate::{camera::camera_impl, Mat4};
#[inline]
#[must_use]
pub fn perspective(vertical_fov: f32, aspect_ratio: f32, near: f32, far: f32) -> Mat4 {
camera_impl::perspective::<false, false, false>(vertical_fov, aspect_ratio, near, far)
}
#[inline]
#[must_use]
pub fn orthographic(left: f32, right: f32, bottom: f32, top: f32, near: f32, far: f32) -> Mat4 {
camera_impl::orthographic::<false, false, false>(left, right, bottom, top, near, far)
}
#[inline]
#[must_use]
pub fn frustum(left: f32, right: f32, bottom: f32, top: f32, near: f32, far: f32) -> Mat4 {
camera_impl::frustum::<false, false, false>(left, right, bottom, top, near, far)
}
}
pub mod vulkan {
use crate::{camera::camera_impl, Mat4};
#[inline]
#[must_use]
pub fn perspective(vertical_fov: f32, aspect_ratio: f32, near: f32, far: f32) -> Mat4 {
camera_impl::perspective::<false, true, true>(vertical_fov, aspect_ratio, near, far)
}
#[inline]
#[must_use]
pub fn perspective_infinite(vertical_fov: f32, aspect_ratio: f32, near: f32) -> Mat4 {
camera_impl::perspective_infinite::<false, true, true>(vertical_fov, aspect_ratio, near)
}
#[inline]
#[must_use]
pub fn perspective_infinite_reverse(vertical_fov: f32, aspect_ratio: f32, near: f32) -> Mat4 {
camera_impl::perspective_infinite_reverse::<false, true>(vertical_fov, aspect_ratio, near)
}
#[inline]
#[must_use]
pub fn orthographic(left: f32, right: f32, bottom: f32, top: f32, near: f32, far: f32) -> Mat4 {
camera_impl::orthographic::<false, true, true>(left, right, bottom, top, near, far)
}
#[inline]
#[must_use]
pub fn frustum(left: f32, right: f32, bottom: f32, top: f32, near: f32, far: f32) -> Mat4 {
camera_impl::frustum::<false, true, true>(left, right, bottom, top, near, far)
}
}
#[doc(alias = "webgpu")]
pub mod directx {
use crate::{camera::camera_impl, Mat4};
#[inline]
#[must_use]
pub fn perspective(vertical_fov: f32, aspect_ratio: f32, near: f32, far: f32) -> Mat4 {
camera_impl::perspective::<false, true, false>(vertical_fov, aspect_ratio, near, far)
}
#[inline]
#[must_use]
pub fn perspective_infinite(vertical_fov: f32, aspect_ratio: f32, near: f32) -> Mat4 {
camera_impl::perspective_infinite::<false, true, false>(vertical_fov, aspect_ratio, near)
}
#[inline]
#[must_use]
pub fn perspective_infinite_reverse(vertical_fov: f32, aspect_ratio: f32, near: f32) -> Mat4 {
camera_impl::perspective_infinite_reverse::<false, false>(vertical_fov, aspect_ratio, near)
}
#[inline]
#[must_use]
pub fn orthographic(left: f32, right: f32, bottom: f32, top: f32, near: f32, far: f32) -> Mat4 {
camera_impl::orthographic::<false, true, false>(left, right, bottom, top, near, far)
}
#[inline]
#[must_use]
pub fn frustum(left: f32, right: f32, bottom: f32, top: f32, near: f32, far: f32) -> Mat4 {
camera_impl::frustum::<false, true, false>(left, right, bottom, top, near, far)
}
}