Class GameObjectBoundsInstantiator
Generates a GameObject hierarchy from a glTF scene and provides its bounding box
Implements
Inherited Members
Namespace: GLTFast
Assembly: glTFast.dll
Syntax
public class GameObjectBoundsInstantiator : GameObjectInstantiator, IInstantiator
Constructors
GameObjectBoundsInstantiator(IGltfReadable, Transform, ICodeLogger, InstantiationSettings)
Constructs a GameObjectInstantiator
Declaration
public GameObjectBoundsInstantiator(IGltfReadable gltf, Transform parent, ICodeLogger logger = null, InstantiationSettings settings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| IGltfReadable | gltf | glTF to instantiate from |
| Transform | parent | Generated GameObjects will get parented to this Transform |
| ICodeLogger | logger | Custom logger |
| InstantiationSettings | settings | Instantiation settings |
Methods
AddPrimitive(uint, string, MeshResult, uint[], uint?, float[], int)
Called for adding a Primitive/Mesh to a Node.
Declaration
public override void AddPrimitive(uint nodeIndex, string meshName, MeshResult meshResult, uint[] joints = null, uint? rootJoint = null, float[] morphTargetWeights = null, int primitiveNumeration = 0)
Parameters
| Type | Name | Description |
|---|---|---|
| uint | nodeIndex | Index of the node |
| string | meshName | Mesh's name |
| MeshResult | meshResult | The converted Mesh |
| uint[] | joints | If a skin was attached, the joint indices. Null otherwise |
| uint? | rootJoint | Root joint node index, if present |
| float[] | morphTargetWeights | Morph target weights, if present |
| int | primitiveNumeration | Primitives are numerated per Node, starting with 0 |
Overrides
BeginScene(string, uint[])
Starts creating a scene instance. Has to be called at first and concluded by calling EndScene(uint[]).
Declaration
public override void BeginScene(string name, uint[] rootNodeIndices)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | Name of the scene |
| uint[] | rootNodeIndices | Indices of root level nodes in scene |
Overrides
CalculateBounds()
Attempts to calculate the instance's bounds
Declaration
public Bounds? CalculateBounds()
Returns
| Type | Description |
|---|---|
| Bounds? | Instance's bounds, if calculation succeeded |