pub struct JsGroupedMesh { /* private fields */ }Expand description
A triangle mesh with per-face triangle grouping, exposed to JavaScript.
The binary counterpart to the JSON tessellateSolidGrouped: positions and
normals are packed Float32Arrays and indices/faceOffsets are
Uint32Arrays, so the whole mesh crosses the WASM boundary as bulk memory
copies instead of a JSON string round-trip. f32 matches what mesh
consumers (GPU vertex buffers) use, halving the transfer versus f64.
Implementations§
Source§impl JsGroupedMesh
impl JsGroupedMesh
Sourcepub fn face_offsets(&self) -> Vec<u32>
pub fn face_offsets(&self) -> Vec<u32>
Per-face start offsets into indices: faceOffsets[i] is the start of
face i, and the final element equals indices.length.
Trait Implementations§
Source§impl Debug for JsGroupedMesh
impl Debug for JsGroupedMesh
Source§impl From<JsGroupedMesh> for JsValue
impl From<JsGroupedMesh> for JsValue
Source§fn from(value: JsGroupedMesh) -> Self
fn from(value: JsGroupedMesh) -> Self
Converts to this type from the input type.
Source§impl FromWasmAbi for JsGroupedMesh
impl FromWasmAbi for JsGroupedMesh
Source§impl IntoWasmAbi for JsGroupedMesh
impl IntoWasmAbi for JsGroupedMesh
Source§impl LongRefFromWasmAbi for JsGroupedMesh
impl LongRefFromWasmAbi for JsGroupedMesh
Source§type Abi = WasmPtr<WasmRefCell<JsGroupedMesh>>
type Abi = WasmPtr<WasmRefCell<JsGroupedMesh>>
Same as
RefFromWasmAbi::AbiSource§type Anchor = RcRef<JsGroupedMesh>
type Anchor = RcRef<JsGroupedMesh>
Same as
RefFromWasmAbi::AnchorSource§unsafe fn long_ref_from_abi(js: Self::Abi) -> Self::Anchor
unsafe fn long_ref_from_abi(js: Self::Abi) -> Self::Anchor
Same as
RefFromWasmAbi::ref_from_abiSource§impl OptionFromWasmAbi for JsGroupedMesh
impl OptionFromWasmAbi for JsGroupedMesh
Source§impl OptionIntoWasmAbi for JsGroupedMesh
impl OptionIntoWasmAbi for JsGroupedMesh
Source§impl RefFromWasmAbi for JsGroupedMesh
impl RefFromWasmAbi for JsGroupedMesh
Source§type Abi = WasmPtr<WasmRefCell<JsGroupedMesh>>
type Abi = WasmPtr<WasmRefCell<JsGroupedMesh>>
The Wasm ABI type references to
Self are recovered from.Source§type Anchor = RcRef<JsGroupedMesh>
type Anchor = RcRef<JsGroupedMesh>
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 JsGroupedMesh
impl RefMutFromWasmAbi for JsGroupedMesh
Source§type Abi = WasmPtr<WasmRefCell<JsGroupedMesh>>
type Abi = WasmPtr<WasmRefCell<JsGroupedMesh>>
Same as
RefFromWasmAbi::AbiSource§type Anchor = RcRefMut<JsGroupedMesh>
type Anchor = RcRefMut<JsGroupedMesh>
Same as
RefFromWasmAbi::AnchorSource§unsafe fn ref_mut_from_abi(js: Self::Abi) -> Self::Anchor
unsafe fn ref_mut_from_abi(js: Self::Abi) -> Self::Anchor
Same as
RefFromWasmAbi::ref_from_abiimpl SupportsConstructor for JsGroupedMesh
impl SupportsInstanceProperty for JsGroupedMesh
impl SupportsStaticProperty for JsGroupedMesh
Source§impl TryFromJsValue for JsGroupedMesh
impl TryFromJsValue for JsGroupedMesh
Source§impl VectorFromWasmAbi for JsGroupedMesh
impl VectorFromWasmAbi for JsGroupedMesh
type Abi = <Box<[JsValue]> as FromWasmAbi>::Abi
unsafe fn vector_from_abi(js: Self::Abi) -> Box<[JsGroupedMesh]>
Source§impl VectorIntoWasmAbi for JsGroupedMesh
impl VectorIntoWasmAbi for JsGroupedMesh
type Abi = <Box<[JsValue]> as IntoWasmAbi>::Abi
fn vector_into_abi(vector: Box<[JsGroupedMesh]>) -> Self::Abi
Source§impl WasmDescribeVector for JsGroupedMesh
impl WasmDescribeVector for JsGroupedMesh
Auto Trait Implementations§
impl Freeze for JsGroupedMesh
impl RefUnwindSafe for JsGroupedMesh
impl Send for JsGroupedMesh
impl Sync for JsGroupedMesh
impl Unpin for JsGroupedMesh
impl UnsafeUnpin for JsGroupedMesh
impl UnwindSafe for JsGroupedMesh
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.