logo
pub struct WorldMesh { /* private fields */ }
Expand description

Represents a reference to a mesh registered with the world.

Implementations

Creates a WorldMesh from the passed-in raw mesh data.

Creates a WorldMesh from the passed-in raw mesh data.

Creates a WorldMesh from GLTF data and additional buffer data. Supports .gltf and .glb, and a single additional buffer file.

Creates a WorldMesh from a GLTF resource handle and additional buffer resource handle

Gets some properties of the mesh, such as its internal bounding box and sphere.

Gets the names of all morph target associated with the mesh.

It is recommended to store the return value instead of calling it every frame.

Obtain all materials associated with the mesh.

It is recommended to store the return value instead of calling it every frame.

Obtain all materials and their name associated with the mesh.

It is recommended to store the return value instead of calling it every frame.

Get the dominant vertex colors of each mesh section and the area they occupy in vertex space

A mesh section is a part of the mesh that has its own material index.

Get the material index assigned to a mesh section

Sets a debug name of this data object. Useful for debugging memory usage and leaks.

Gets the DataHandle of this mesh.

Adopts a raw data handle and increases its ref count.

Adopts a raw data handle and increases its ref count if it is a valid data object.

Returns true if this is a valid mesh. This should always be the case unless something has gone very wrong, such as the case where a user created this object from

Returns this mesh as a simplified WorldMesh using target_error and threshold parameters. threshold meaning what percentage (0-1) of the original primitives it should keep. target_error is an approximate measure of the deviation from the original mesh using distance normalized to 0..1 (so 1e-2f means that simplifier will try to maintain the error to be below 1% of the mesh extents). Note that because of topological restrictions and error bounds simplifier isn’t guaranteed to reach the target index count and can stop earlier. min_triangle_count and max_triangle_count can be used instead of threshold or in conjunction to define a minimum limit and maximum budget. If this range is outside of the number of triangles for the mesh no simplification will be done (target triangle count will be equal to the amount of triangles in the mesh)

Returns a new mesh simplified to target_triangle_count, as long as it can keep the error below max_error. max_error is an approximate measure of the deviation from the original mesh using distance normalized to 0..1 (so 1e-2f means that simplifier will try to maintain the error to be below 1% of the mesh extents).

Returns a new mesh simplified as much as it can while not exceeding target_error. target_error is an approximate measure of the deviation from the original mesh using distance normalized to 0..1 (so 1e-2f means that simplifier will try to maintain the error to be below 1% of the mesh extents).

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Wraps the passed-in value in a Value enum.

Extracts the value from a Value enum.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.

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

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.