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