Class GltfBoundsAsset
Base component for code-less loading of glTF files Extends GltfAsset with bounding box calculation
Inherited Members
Namespace: GLTFast
Assembly: glTFast.dll
Syntax
public class GltfBoundsAsset : GltfAsset
Properties
Bounds
Bounding box of the instantiated glTF scene
Declaration
public Bounds Bounds { get; }
Property Value
Type | Description |
---|---|
Bounds |
CreateBoxCollider
If true, a box collider encapsulating the glTF scene is created (only if the built-in Physics module is enabled).
Declaration
public bool CreateBoxCollider { get; set; }
Property Value
Type | Description |
---|---|
bool |
Methods
GetDefaultInstantiator(ICodeLogger)
Returns an instance of the default instantiator
Declaration
protected override IInstantiator GetDefaultInstantiator(ICodeLogger logger)
Parameters
Type | Name | Description |
---|---|---|
ICodeLogger | logger | Custom logger to use with the instantiator |
Returns
Type | Description |
---|---|
IInstantiator | Default instantiator instance |
Overrides
InstantiateScene(int, ICodeLogger)
Creates an instance of the scene specified by the scene index.
Declaration
public override Task<bool> InstantiateScene(int sceneIndex, ICodeLogger logger = null)
Parameters
Type | Name | Description |
---|---|---|
int | sceneIndex | Index of the scene to be instantiated |
ICodeLogger | logger | Used for message reporting |
Returns
Type | Description |
---|---|
Task<bool> | True if instantiation was successful. |
Overrides
Load(string, IDownloadProvider, IDeferAgent, IMaterialGenerator, ICodeLogger)
Method for manual loading with custom IDownloadProvider and IDeferAgent.
Declaration
public override Task<bool> Load(string gltfUrl, IDownloadProvider downloadProvider = null, IDeferAgent deferAgent = null, IMaterialGenerator materialGenerator = null, ICodeLogger logger = null)
Parameters
Type | Name | Description |
---|---|---|
string | gltfUrl | URL of the glTF file. |
IDownloadProvider | downloadProvider | Download Provider for custom loading (e.g. caching or HTTP authorization) |
IDeferAgent | deferAgent | Defer Agent takes care of interrupting the loading procedure in order to keep the frame rate responsive. |
IMaterialGenerator | materialGenerator | Used to convert glTF materials to Material instances |
ICodeLogger | logger | Used for message reporting |
Returns
Type | Description |
---|---|
Task<bool> | Async Task that loads the glTF's contents |