Class GLBRuntime
Loads GLB files at runtime.
Namespace: Evergine.Runtimes.GLB
Assembly: Evergine.Runtimes.GLB.dll
Syntax
public class GLBRuntime : ModelRuntime
Constructors
GLBRuntime(GraphicsContext, AssetsDirectory, AssetsService)
Initializes a new instance of the GLBRuntime class.
Declaration
public GLBRuntime(GraphicsContext graphicsContext, AssetsDirectory assetsDirectory, AssetsService assetsService)
Parameters
| Type | Name | Description |
|---|---|---|
| GraphicsContext | graphicsContext | Graphics Context instance. |
| AssetsDirectory | assetsDirectory | Assets Directory instance. |
| AssetsService | assetsService | Assets Service instance. |
Fields
Instance
Gets the a default instance of the class resolving the required services using the default Evergine container.
Declaration
public static readonly GLBRuntime Instance
Field Value
| Type | Description |
|---|---|
| GLBRuntime |
Properties
Extension
Gets the 3D format extension.
Declaration
public override string Extension { get; }
Property Value
| Type | Description |
|---|---|
| string |
Overrides
Methods
LoadStaticResources()
Loads the static resources required for the GLB runtime.
Declaration
public void LoadStaticResources()
Read(Stream, Func<MaterialData, Task<Material>>)
Reads a GLB file from the stream and returns a model asset.
Declaration
public override Task<Model> Read(Stream stream, Func<MaterialData, Task<Material>> materialAssigner = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Stream | stream | The stream to read from. The stream must be seekable. |
| Func<MaterialData, Task<Material>> | materialAssigner | The material assigner. |
Returns
| Type | Description |
|---|---|
| Task<Model> | The loaded model asset. |
Overrides
Read(string, Func<MaterialData, Task<Material>>)
Reads a GLB file and returns a model asset.
Declaration
public Task<Model> Read(string filePath, Func<MaterialData, Task<Material>> materialAssigner = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | filePath | The GLB file path. |
| Func<MaterialData, Task<Material>> | materialAssigner | The material assigner. |
Returns
| Type | Description |
|---|---|
| Task<Model> | The model asset. |