pub struct UVUnwrap;Expand description
UV unwrapping projection modes.
Implementations§
Source§impl UVUnwrap
impl UVUnwrap
Sourcepub fn cylindrical(position: Vec3, height: f32) -> [f32; 2]
pub fn cylindrical(position: Vec3, height: f32) -> [f32; 2]
Cylindrical UV projection around the Y axis.
Maps position to UV: u = atan2(z, x) / TAU, v = y / height.
Sourcepub fn spherical(position: Vec3) -> [f32; 2]
pub fn spherical(position: Vec3) -> [f32; 2]
Spherical UV projection.
Maps position to UV using spherical coordinates.
Sourcepub fn box_projection(position: Vec3, normal: Vec3) -> [f32; 2]
pub fn box_projection(position: Vec3, normal: Vec3) -> [f32; 2]
Box (cube) projection — project from the most-facing axis.
Sourcepub fn planar(
position: Vec3,
origin: Vec3,
u_axis: Vec3,
v_axis: Vec3,
) -> [f32; 2]
pub fn planar( position: Vec3, origin: Vec3, u_axis: Vec3, v_axis: Vec3, ) -> [f32; 2]
Planar projection onto a plane defined by origin, u-axis, and v-axis.
Sourcepub fn camera_projection(
position: Vec3,
camera_pos: Vec3,
camera_forward: Vec3,
camera_up: Vec3,
fov: f32,
) -> [f32; 2]
pub fn camera_projection( position: Vec3, camera_pos: Vec3, camera_forward: Vec3, camera_up: Vec3, fov: f32, ) -> [f32; 2]
Camera (view-space) projection.
Sourcepub fn cylindrical_array(positions: &[Vec3], height: f32) -> Vec<[f32; 2]>
pub fn cylindrical_array(positions: &[Vec3], height: f32) -> Vec<[f32; 2]>
Unwrap an array of positions using cylindrical projection.
Sourcepub fn spherical_array(positions: &[Vec3]) -> Vec<[f32; 2]>
pub fn spherical_array(positions: &[Vec3]) -> Vec<[f32; 2]>
Unwrap an array of positions using spherical projection.
Auto Trait Implementations§
impl Freeze for UVUnwrap
impl RefUnwindSafe for UVUnwrap
impl Send for UVUnwrap
impl Sync for UVUnwrap
impl Unpin for UVUnwrap
impl UnsafeUnpin for UVUnwrap
impl UnwindSafe for UVUnwrap
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.