docs.unity3d.com
    Show / Hide Table of Contents

    Class GameObjectBoundsInstantiator

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

    Inheritance
    Object
    GameObjectInstantiator
    GameObjectBoundsInstantiator
    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(UInt32, Nullable<UInt32>, Vector3, Quaternion, Vector3)
    GameObjectInstantiator.SetNodeName(UInt32, String)
    GameObjectInstantiator.AddPrimitiveInstanced(UInt32, String, Mesh, Int32[], UInt32, Nullable<NativeArray<Vector3>>, Nullable<NativeArray<Quaternion>>, Nullable<NativeArray<Vector3>>, Int32)
    GameObjectInstantiator.AddCamera(UInt32, UInt32)
    GameObjectInstantiator.AddLightPunctual(UInt32, UInt32)
    GameObjectInstantiator.EndScene(UInt32[])
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: GLTFast
    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(UInt32, String, Mesh, Int32[], UInt32[], Nullable<UInt32>, Single[], Int32)

    Called for adding a Primitive/Mesh to a Node.

    Declaration
    public override void AddPrimitive(uint nodeIndex, string meshName, Mesh mesh, int[] materialIndices, uint[] joints = null, uint? rootJoint = null, float[] morphTargetWeights = null, int primitiveNumeration = 0)
    Parameters
    Type Name Description
    UInt32 nodeIndex

    Index of the node

    String meshName

    Mesh's name

    Mesh mesh

    The actual Mesh

    Int32[] materialIndices

    Material indices. Should be used to query the material

    UInt32[] joints

    If a skin was attached, the joint indices. Null otherwise

    Nullable<UInt32> rootJoint

    Root joint node index, if present

    Single[] morphTargetWeights

    Morph target weights, if present

    Int32 primitiveNumeration

    Primitives are numerated per Node, starting with 0

    Overrides
    GameObjectInstantiator.AddPrimitive(UInt32, String, Mesh, Int32[], UInt32[], Nullable<UInt32>, Single[], Int32)

    BeginScene(String, UInt32[])

    Starts creating a scene instance. Has to be called at first and concluded by calling EndScene(UInt32[]).

    Declaration
    public override void BeginScene(string name, uint[] rootNodeIndices)
    Parameters
    Type Name Description
    String name

    Name of the scene

    UInt32[] rootNodeIndices

    Indices of root level nodes in scene

    Overrides
    GameObjectInstantiator.BeginScene(String, UInt32[])

    CalculateBounds()

    Attempts to calculate the instance's bounds

    Declaration
    public Bounds? CalculateBounds()
    Returns
    Type Description
    Nullable<Bounds>

    Instance's bounds, if calculation succeeded

    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023