docs.unity3d.com
    Show / Hide Table of Contents

    Class MeshPrimitive

    Geometry to be rendered with the given material.

    Inheritance
    Object
    MeshPrimitive
    Inherited Members
    Object.ToString()
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: GLTFast.Schema
    Syntax
    [Serializable]
    public class MeshPrimitive : ICloneable

    Fields

    attributes

    A dictionary object, where each key corresponds to mesh attribute semantic and each value is the index of the accessor containing attribute's data.

    Declaration
    public Attributes attributes
    Field Value
    Type Description
    Attributes

    extensions

    Declaration
    public MeshPrimitiveExtensions extensions
    Field Value
    Type Description
    MeshPrimitiveExtensions

    indices

    The index of the accessor that contains mesh indices. When this is not defined, the primitives should be rendered without indices using drawArrays(). When defined, the accessor must contain indices: the bufferView referenced by the accessor must have a target equal to 34963 (ELEMENT_ARRAY_BUFFER); a byteStride that is tightly packed, i.e., 0 or the byte size of componentType in bytes; componentType must be 5121 (UNSIGNED_BYTE), 5123 (UNSIGNED_SHORT) or 5125 (UNSIGNED_INT), the latter is only allowed when OES_element_index_uint extension is used; type must be \"SCALAR\".

    Declaration
    public int indices
    Field Value
    Type Description
    Int32

    material

    The index of the material to apply to this primitive when rendering.

    Declaration
    public int material
    Field Value
    Type Description
    Int32

    mode

    The type of primitives to render. All valid values correspond to WebGL enums.

    Declaration
    public DrawMode mode
    Field Value
    Type Description
    DrawMode

    targets

    An array of Morph Targets, each Morph Target is a dictionary mapping attributes to their deviations in the Morph Target (index of the accessor containing the attribute displacements' data).

    Declaration
    public MorphTarget[] targets
    Field Value
    Type Description
    MorphTarget[]

    Properties

    IsDracoCompressed

    Declaration
    public bool IsDracoCompressed { get; }
    Property Value
    Type Description
    Boolean

    Methods

    Clone()

    Clones the object

    Declaration
    public object Clone()
    Returns
    Type Description
    Object

    Member-wise clone

    Implements
    ICloneable.Clone()

    Equals(Object)

    Primitives are considered equal if their attributes and morph targets (if existing) are equal. This is practical when clustering primitives of a mesh together, that end up in a single Unity Mesh.

    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    Object obj

    Object to compare against

    Returns
    Type Description
    Boolean

    True if attributes and morph targets are equal, false otherwise

    Overrides
    Object.Equals(Object)

    GetHashCode()

    Default hash function.

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    Int32

    A hash code for the current object.

    Overrides
    Object.GetHashCode()
    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