Skip to main content

FbxMeshInstance

Struct FbxMeshInstance 

Source
pub struct FbxMeshInstance {
    pub name: Option<String>,
    pub mesh: Mesh,
    pub control_points: Vec<[f32; 3]>,
    pub polygon_vertex_indices: Vec<i32>,
    pub layers: FbxMeshLayers,
    pub edges: Vec<i32>,
    pub material_indices: Vec<i32>,
    pub skin: Option<FbxSkin>,
    pub morph_targets: Vec<FbxMorphTarget>,
    pub geometric_transform: Option<FbxGeometricTransform>,
}
Available on crate features fbx-reader or fbx-writer only.
Expand description

Geometry attached to one FbxSceneNode.

This is materialized Draco geometry, not a lossless FBX geometry object.

Fields§

§name: Option<String>

Name supplied by the FBX geometry node, when available.

§mesh: Mesh

Decoded mesh geometry.

§control_points: Vec<[f32; 3]>

Original FBX control-point positions, retained independently from the resolved render mesh used by Draco/WebGL.

§polygon_vertex_indices: Vec<i32>

Original FBX polygon-corner indices. Negative values terminate a face.

§layers: FbxMeshLayers

Layer elements preserved from the source geometry node.

§edges: Vec<i32>

Original FBX Edges array, verbatim.

Each entry indexes Self::polygon_vertex_indices, naming the polygon corner an edge starts at. FBX does not require this to list every topological edge – importers reconstruct the missing ones from faces – so it is kept raw rather than normalized. It is also the domain ByEdge layer elements address.

§material_indices: Vec<i32>

Per-polygon material index from LayerElementMaterial, when present.

Each entry corresponds to one triangle in fan-triangulation order produced by crate::FbxReader. Entries are absolute indices into FbxScene::materials. The list is empty when the geometry does not carry a material layer (callers fall back to the first material).

§skin: Option<FbxSkin>

Skin binding for this geometry, when it is armature-deformed.

§morph_targets: Vec<FbxMorphTarget>

Blend-shape targets defined for this geometry.

§geometric_transform: Option<FbxGeometricTransform>

The attaching Model’s Geometric* offset, when it sets one.

It sits here rather than on the node because FBX does not pass it to child nodes: a consumer places this geometry with node_transform * geometric_transform and places the children with the node transform alone.

Implementations§

Source§

impl FbxMeshInstance

Source

pub fn to_render_mesh(&self) -> FbxRenderMesh

Expands this instance onto the polygon-corner domain.

Source

pub fn to_draco_mesh(&self) -> Mesh

Corner-domain Draco mesh for this instance, welded by attribute tuple.

Falls back to the stored mesh when the instance carries no raw FBX geometry to expand.

Source

pub fn to_draco_mesh_with_corner_map(&self) -> DracoMeshWithCornerMap

Self::to_draco_mesh, additionally returning the corner/point correspondence the weld produced – what a caller needs to carry a per-control-point skin weight or morph delta onto the welded points that now stand in for the corners it used to be duplicated across.

The stored-mesh fallback has no corners to map from, so both maps are the identity over its own points – matching the WASM binding’s own prior assumption that a point is its control point when there is no raw geometry to re-derive one from.

Trait Implementations§

Source§

impl Clone for FbxMeshInstance

Source§

fn clone(&self) -> FbxMeshInstance

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for FbxMeshInstance

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for FbxMeshInstance

Source§

fn default() -> FbxMeshInstance

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.