pub struct ZeroCopyMesh { /* private fields */ }Expand description
Zero-copy mesh that exposes pointers to WASM memory
Implementations§
Source§impl ZeroCopyMesh
impl ZeroCopyMesh
Sourcepub fn positions_ptr(&self) -> *const f32
pub fn positions_ptr(&self) -> *const f32
Get pointer to positions array JavaScript can create Float32Array view: new Float32Array(memory.buffer, ptr, length)
Sourcepub fn positions_len(&self) -> usize
pub fn positions_len(&self) -> usize
Get length of positions array (in f32 elements, not bytes)
Sourcepub fn normals_ptr(&self) -> *const f32
pub fn normals_ptr(&self) -> *const f32
Get pointer to normals array
Sourcepub fn normals_len(&self) -> usize
pub fn normals_len(&self) -> usize
Get length of normals array
Sourcepub fn indices_ptr(&self) -> *const u32
pub fn indices_ptr(&self) -> *const u32
Get pointer to indices array
Sourcepub fn indices_len(&self) -> usize
pub fn indices_len(&self) -> usize
Get length of indices array
Sourcepub fn vertex_count(&self) -> usize
pub fn vertex_count(&self) -> usize
Get vertex count
Sourcepub fn triangle_count(&self) -> usize
pub fn triangle_count(&self) -> usize
Get triangle count
Sourcepub fn bounds_min(&self) -> Vec<f32>
pub fn bounds_min(&self) -> Vec<f32>
Get bounding box minimum point
Sourcepub fn bounds_max(&self) -> Vec<f32>
pub fn bounds_max(&self) -> Vec<f32>
Get bounding box maximum point
Trait Implementations§
Source§impl Default for ZeroCopyMesh
impl Default for ZeroCopyMesh
Source§impl From<Mesh> for ZeroCopyMesh
impl From<Mesh> for ZeroCopyMesh
Source§impl From<ZeroCopyMesh> for JsValue
impl From<ZeroCopyMesh> for JsValue
Source§fn from(value: ZeroCopyMesh) -> Self
fn from(value: ZeroCopyMesh) -> Self
Converts to this type from the input type.
Source§impl FromWasmAbi for ZeroCopyMesh
impl FromWasmAbi for ZeroCopyMesh
Source§impl IntoWasmAbi for ZeroCopyMesh
impl IntoWasmAbi for ZeroCopyMesh
Source§impl LongRefFromWasmAbi for ZeroCopyMesh
impl LongRefFromWasmAbi for ZeroCopyMesh
Source§impl OptionFromWasmAbi for ZeroCopyMesh
impl OptionFromWasmAbi for ZeroCopyMesh
Source§impl OptionIntoWasmAbi for ZeroCopyMesh
impl OptionIntoWasmAbi for ZeroCopyMesh
Source§impl RefFromWasmAbi for ZeroCopyMesh
impl RefFromWasmAbi for ZeroCopyMesh
Source§type Anchor = RcRef<ZeroCopyMesh>
type Anchor = RcRef<ZeroCopyMesh>
The type that holds the reference to
Self for the duration of the
invocation of the function that has an &Self parameter. This is
required to ensure that the lifetimes don’t persist beyond one function
call, and so that they remain anonymous.Source§impl RefMutFromWasmAbi for ZeroCopyMesh
impl RefMutFromWasmAbi for ZeroCopyMesh
Source§impl TryFromJsValue for ZeroCopyMesh
impl TryFromJsValue for ZeroCopyMesh
Source§impl VectorFromWasmAbi for ZeroCopyMesh
impl VectorFromWasmAbi for ZeroCopyMesh
type Abi = <Box<[JsValue]> as FromWasmAbi>::Abi
unsafe fn vector_from_abi(js: Self::Abi) -> Box<[ZeroCopyMesh]>
Source§impl VectorIntoWasmAbi for ZeroCopyMesh
impl VectorIntoWasmAbi for ZeroCopyMesh
type Abi = <Box<[JsValue]> as IntoWasmAbi>::Abi
fn vector_into_abi(vector: Box<[ZeroCopyMesh]>) -> Self::Abi
Source§impl WasmDescribeVector for ZeroCopyMesh
impl WasmDescribeVector for ZeroCopyMesh
impl SupportsConstructor for ZeroCopyMesh
impl SupportsInstanceProperty for ZeroCopyMesh
impl SupportsStaticProperty for ZeroCopyMesh
Auto Trait Implementations§
impl Freeze for ZeroCopyMesh
impl RefUnwindSafe for ZeroCopyMesh
impl Send for ZeroCopyMesh
impl Sync for ZeroCopyMesh
impl Unpin for ZeroCopyMesh
impl UnwindSafe for ZeroCopyMesh
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
Source§type Abi = <T as IntoWasmAbi>::Abi
type Abi = <T as IntoWasmAbi>::Abi
Same as
IntoWasmAbi::AbiSource§fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
Same as
IntoWasmAbi::into_abi, except that it may throw and never
return in the case of Err.Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.