docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class GameObjectBoundsInstantiator

    Generates a GameObject hierarchy from a glTF scene and provides its bounding box

    Inheritance
    object
    GameObjectInstantiator
    GameObjectBoundsInstantiator
    Implements
    IInstantiator
    Inherited Members
    GameObjectInstantiator.m_Settings
    GameObjectInstantiator.m_Logger
    GameObjectInstantiator.m_Gltf
    GameObjectInstantiator.m_Parent
    GameObjectInstantiator.m_Nodes
    GameObjectInstantiator.SceneTransform
    GameObjectInstantiator.SceneInstance
    GameObjectInstantiator.AddAnimation(AnimationClip[])
    GameObjectInstantiator.CreateNode(uint, uint?, Vector3, Quaternion, Vector3)
    GameObjectInstantiator.SetNodeName(uint, string)
    GameObjectInstantiator.AddPrimitiveInstanced(uint, string, MeshResult, uint, NativeArray<Vector3>?, NativeArray<Quaternion>?, NativeArray<Vector3>?, int)
    GameObjectInstantiator.AddCamera(uint, uint)
    GameObjectInstantiator.AddLightPunctual(uint, uint)
    GameObjectInstantiator.EndScene(uint[])
    GameObjectInstantiator.NodeCreated
    GameObjectInstantiator.MeshAdded
    GameObjectInstantiator.EndSceneCompleted
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    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
    GameObjectInstantiator.AddPrimitive(uint, string, MeshResult, uint[], uint?, float[], int)

    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
    GameObjectInstantiator.BeginScene(string, uint[])

    CalculateBounds()

    Attempts to calculate the instance's bounds

    Declaration
    public Bounds? CalculateBounds()
    Returns
    Type Description
    Bounds?

    Instance's bounds, if calculation succeeded

    Implements

    IInstantiator
    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)