pub struct ResidentMesh(/* private fields */);Implementations§
Source§impl ResidentMesh
impl ResidentMesh
Sourcepub fn new(mesh: &Mesh) -> Result<ResidentMesh, &'static str>
pub fn new(mesh: &Mesh) -> Result<ResidentMesh, &'static str>
Snapshot validated geometry. Changes to the source Mesh require a new snapshot.
Use Self::try_new for structured errors with source locations.
Sourcepub fn try_new(mesh: &Mesh) -> Result<ResidentMesh, MeshError>
pub fn try_new(mesh: &Mesh) -> Result<ResidentMesh, MeshError>
Snapshot geometry after validating all source vertices and triangle indices. Validation failure neither registers geometry nor consumes a mesh identity. Cloning the returned handle shares the snapshot and its GPU buffers.
use ferravex_render::{mesh::Mesh3d, retained::ResidentMesh, Vec3, WHITE};
let source = Mesh3d::cuboid(Vec3::ONE, WHITE).mesh;
let resident = ResidentMesh::try_new(&source)?;
assert_eq!(resident.vertex_count(), source.indices.len());pub fn id(&self) -> u32
pub fn vertex_count(&self) -> usize
pub fn bounds(&self) -> Bounds
Trait Implementations§
Source§impl Clone for ResidentMesh
impl Clone for ResidentMesh
Source§fn clone(&self) -> ResidentMesh
fn clone(&self) -> ResidentMesh
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ResidentMesh
impl RefUnwindSafe for ResidentMesh
impl !Send for ResidentMesh
impl !Sync for ResidentMesh
impl Unpin for ResidentMesh
impl UnwindSafe for ResidentMesh
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