ModelAsset

Represents a raw model asset that can be loaded into the engine.

This record encapsulates the source of the model data (e.g., a file or stream), its name, and metadata. It provides methods to load and parse the model data into a usable format.

Since

2.0.0

Parameters

rawName

the original raw name or path of the asset

name

the sanitized, pack-compliant name of the asset

sizeAssume

the estimated size of the asset in bytes (0 if unknown)

supplier

a supplier for the input stream containing the model data

Constructors

Link copied to clipboard
@ApiStatus.Internal
constructor(@NotNull rawName: @NotNull String, @NotNull name: @NotNull String, sizeAssume: Long, @NotNull supplier: @NotNull ModelAsset.StreamSupplier)
Internal constructor for ModelAsset.

Types

Link copied to clipboard
interface StreamSupplier
A functional interface for supplying an input stream.

Functions

Link copied to clipboard
open fun compareTo(@NotNull o: @NotNull ModelAsset): Int
Link copied to clipboard
open fun equals(o: Any): Boolean
Link copied to clipboard
open fun hashCode(): Int
Link copied to clipboard
@NotNull
open fun of(@NotNull file: @NotNull File): @NotNull ModelAsset
Creates a new ModelAsset from a file.
@NotNull
open fun of(@NotNull path: @NotNull Path): @NotNull ModelAsset
Creates a new ModelAsset from a path.
@NotNull
open fun of(@NotNull name: @NotNull String, bytes: Array<Byte>): @NotNull ModelAsset
Creates a new ModelAsset from a name and byte array.
@NotNull
open fun of(@NotNull name: @NotNull String, @NotNull supplier: @NotNull ModelAsset.StreamSupplier): @NotNull ModelAsset
Creates a new ModelAsset from a name and stream supplier.
@NotNull
open fun of(@NotNull name: @NotNull String, sizeAssume: Long, @NotNull supplier: @NotNull ModelAsset.StreamSupplier): @NotNull ModelAsset
Creates a new ModelAsset from a name, stream supplier, and estimated size.
Link copied to clipboard
@NotNull
open fun toResult(): @NotNull ModelLoadResult
Loads and parses the model data from this asset.
Link copied to clipboard
@NotNull
open fun toString(): @NotNull String