Class MeshHelper | Project Tiny Rendering | 0.24.0-preview.1
docs.unity3d.com
    Show / Hide Table of Contents

    Class MeshHelper

    Inheritance
    Object
    MeshHelper
    Namespace: Unity.Tiny.Rendering
    Syntax
    public static class MeshHelper

    Methods

    AsNativeArray<T>(ref BlobArray<T>)

    Declaration
    public static NativeArray<T> AsNativeArray<T>(ref BlobArray<T> ba)
        where T : struct
    Parameters
    Type Name Description
    BlobArray<T> ba
    Returns
    Type Description
    NativeArray<T>
    Type Parameters
    Name Description
    T

    AsNativeArray<T>(BlobBuilderArray<T>)

    Declaration
    public static NativeArray<T> AsNativeArray<T>(this BlobBuilderArray<T> bba)
        where T : struct
    Parameters
    Type Name Description
    BlobBuilderArray<T> bba
    Returns
    Type Description
    NativeArray<T>
    Type Parameters
    Name Description
    T

    ComputeBounds(NativeArray<LitVertex>)

    Declaration
    public static AABB ComputeBounds(NativeArray<LitVertex> vertices)
    Parameters
    Type Name Description
    NativeArray<LitVertex> vertices
    Returns
    Type Description
    AABB

    ComputeBounds(NativeArray<SimpleVertex>)

    Declaration
    public static AABB ComputeBounds(NativeArray<SimpleVertex> vertices)
    Parameters
    Type Name Description
    NativeArray<SimpleVertex> vertices
    Returns
    Type Description
    AABB

    ComputeNormals(NativeArray<LitVertex>, NativeArray<UInt16>, Boolean)

    Declaration
    public static void ComputeNormals(NativeArray<LitVertex> vertices, NativeArray<ushort> indices, bool clear = false)
    Parameters
    Type Name Description
    NativeArray<LitVertex> vertices
    NativeArray<UInt16> indices
    Boolean clear

    ComputeTangentAndBinormal(NativeArray<LitVertex>, NativeArray<UInt16>)

    Declaration
    public static void ComputeTangentAndBinormal(NativeArray<LitVertex> vertices, NativeArray<ushort> indices)
    Parameters
    Type Name Description
    NativeArray<LitVertex> vertices
    NativeArray<UInt16> indices

    CreateBoxMesh(float3, out MeshBounds, out LitMeshRenderData)

    Declaration
    public static void CreateBoxMesh(float3 size, out MeshBounds mb, out LitMeshRenderData lmrd)
    Parameters
    Type Name Description
    float3 size
    MeshBounds mb
    LitMeshRenderData lmrd

    CreateDonutMesh(Single, Int32, Single, Int32, out MeshBounds, out LitMeshRenderData)

    Declaration
    public static void CreateDonutMesh(float innerR, int innerN, float outerR, int outerN, out MeshBounds mb, out LitMeshRenderData lmrd)
    Parameters
    Type Name Description
    Single innerR
    Int32 innerN
    Single outerR
    Int32 outerN
    MeshBounds mb
    LitMeshRenderData lmrd

    CreateExtrudedLineMesh(Single, Single, Single, Int32, NativeArray<float3>, out MeshBounds, out LitMeshRenderData)

    Declaration
    public static void CreateExtrudedLineMesh(float radius, float taperLen, float uLen, int nSegments, NativeArray<float3> centerline, out MeshBounds mb, out LitMeshRenderData lmrd)
    Parameters
    Type Name Description
    Single radius
    Single taperLen
    Single uLen
    Int32 nSegments
    NativeArray<float3> centerline
    MeshBounds mb
    LitMeshRenderData lmrd

    CreatePlane(float3, float3, float3, out MeshBounds, out SimpleMeshRenderData)

    Declaration
    public static void CreatePlane(float3 org, float3 du, float3 dv, out MeshBounds mb, out SimpleMeshRenderData smrd)
    Parameters
    Type Name Description
    float3 org
    float3 du
    float3 dv
    MeshBounds mb
    SimpleMeshRenderData smrd

    CreatePlaneLit(float3, float3, float3, out MeshBounds, out LitMeshRenderData)

    Declaration
    public static void CreatePlaneLit(float3 org, float3 du, float3 dv, out MeshBounds mb, out LitMeshRenderData lmrd)
    Parameters
    Type Name Description
    float3 org
    float3 du
    float3 dv
    MeshBounds mb
    LitMeshRenderData lmrd

    CreateSuperEllipsoid(float3, NativeArray<LitVertex>, NativeArray<UInt16>, Single, Single, Int32, Int32, out AABB)

    Declaration
    public static void CreateSuperEllipsoid(float3 size, NativeArray<LitVertex> vertices, NativeArray<ushort> indices, float e, float n, int tessU, int tessV, out AABB bb)
    Parameters
    Type Name Description
    float3 size
    NativeArray<LitVertex> vertices
    NativeArray<UInt16> indices
    Single e
    Single n
    Int32 tessU
    Int32 tessV
    AABB bb

    CreateSuperEllipsoidMesh(float3, Single, Single, Int32, Int32, out MeshBounds, out LitMeshRenderData)

    Declaration
    public static void CreateSuperEllipsoidMesh(float3 size, float r, float t, int tessU, int tessV, out MeshBounds mb, out LitMeshRenderData lmrd)
    Parameters
    Type Name Description
    float3 size
    Single r
    Single t
    Int32 tessU
    Int32 tessV
    MeshBounds mb
    LitMeshRenderData lmrd

    CreateSuperTorusKnotMesh(Single, Int32, Single, Int32, Int32, Int32, Single, Single, out MeshBounds, out LitMeshRenderData)

    Declaration
    public static void CreateSuperTorusKnotMesh(float innerR, int innerN, float outerR, int outerN, int p, int q, float innerE, float outerE, out MeshBounds mb, out LitMeshRenderData lmrd)
    Parameters
    Type Name Description
    Single innerR
    Int32 innerN
    Single outerR
    Int32 outerN
    Int32 p
    Int32 q
    Single innerE
    Single outerE
    MeshBounds mb
    LitMeshRenderData lmrd

    ECos(Single, Single)

    Declaration
    public static float ECos(float x, float e)
    Parameters
    Type Name Description
    Single x
    Single e
    Returns
    Type Description
    Single

    ESin(Single, Single)

    Declaration
    public static float ESin(float x, float e)
    Parameters
    Type Name Description
    Single x
    Single e
    Returns
    Type Description
    Single

    EvalCatmullRom(float3x4, Single)

    Declaration
    public static float3 EvalCatmullRom(in float3x4 m, float t)
    Parameters
    Type Name Description
    float3x4 m
    Single t
    Returns
    Type Description
    float3

    EvalSuperCircle(Single, Single)

    Declaration
    public static float2 EvalSuperCircle(float phi, float e)
    Parameters
    Type Name Description
    Single phi
    Single e
    Returns
    Type Description
    float2

    EvalSuperTorusKnotCenterLine(Single, Int32, Int32, Single)

    Declaration
    public static float3 EvalSuperTorusKnotCenterLine(float phi, int p, int q, float e)
    Parameters
    Type Name Description
    Single phi
    Int32 p
    Int32 q
    Single e
    Returns
    Type Description
    float3

    ExtrudedLineMeshRequiredIndices(Int32, Int32)

    Declaration
    public static int ExtrudedLineMeshRequiredIndices(int nCenterLineVertices, int nSegments)
    Parameters
    Type Name Description
    Int32 nCenterLineVertices
    Int32 nSegments
    Returns
    Type Description
    Int32

    ExtrudedLineMeshRequiredVertices(Int32, Int32)

    Declaration
    public static int ExtrudedLineMeshRequiredVertices(int nCenterLineVertices, int nSegments)
    Parameters
    Type Name Description
    Int32 nCenterLineVertices
    Int32 nSegments
    Returns
    Type Description
    Int32

    FillBoxMesh(float3, NativeArray<LitVertex>, NativeArray<UInt16>, out AABB)

    Declaration
    public static void FillBoxMesh(float3 size, NativeArray<LitVertex> vertices, NativeArray<ushort> indices, out AABB bb)
    Parameters
    Type Name Description
    float3 size
    NativeArray<LitVertex> vertices
    NativeArray<UInt16> indices
    AABB bb

    FillDonut(NativeArray<LitVertex>, NativeArray<UInt16>, Single, Int32, Single, Int32)

    Declaration
    public static void FillDonut(NativeArray<LitVertex> vertices, NativeArray<ushort> indices, float innerR, int innerN, float outerR, int outerN)
    Parameters
    Type Name Description
    NativeArray<LitVertex> vertices
    NativeArray<UInt16> indices
    Single innerR
    Int32 innerN
    Single outerR
    Int32 outerN

    FillExtrudedLine(NativeArray<LitVertex>, NativeArray<UInt16>, Single, Single, Single, NativeArray<float3>, NativeArray<float2>, NativeArray<Single>, Boolean)

    Declaration
    public static void FillExtrudedLine(NativeArray<LitVertex> vertices, NativeArray<ushort> indices, float radius, float taperLen, float uLen, NativeArray<float3> centerline, NativeArray<float2> profile, NativeArray<float> taper, bool closed)
    Parameters
    Type Name Description
    NativeArray<LitVertex> vertices
    NativeArray<UInt16> indices
    Single radius
    Single taperLen
    Single uLen
    NativeArray<float3> centerline
    NativeArray<float2> profile
    NativeArray<Single> taper
    Boolean closed

    FillExtrudedLineCircle(NativeArray<LitVertex>, NativeArray<UInt16>, Single, Single, Single, NativeArray<float3>, Int32, Boolean)

    Declaration
    public static void FillExtrudedLineCircle(NativeArray<LitVertex> vertices, NativeArray<ushort> indices, float radius, float taperLen, float uLen, NativeArray<float3> centerline, int nSegments, bool closed)
    Parameters
    Type Name Description
    NativeArray<LitVertex> vertices
    NativeArray<UInt16> indices
    Single radius
    Single taperLen
    Single uLen
    NativeArray<float3> centerline
    Int32 nSegments
    Boolean closed

    FillPlanarIndices(Int32, Int32, NativeArray<UInt16>)

    Declaration
    public static void FillPlanarIndices(int tessU, int tessV, NativeArray<ushort> indices)
    Parameters
    Type Name Description
    Int32 tessU
    Int32 tessV
    NativeArray<UInt16> indices

    FillPlaneMesh(NativeArray<SimpleVertex>, NativeArray<UInt16>, float3, float3, float3, out AABB)

    Declaration
    public static void FillPlaneMesh(NativeArray<SimpleVertex> destVertices, NativeArray<ushort> destIndices, float3 org, float3 du, float3 dv, out AABB bb)
    Parameters
    Type Name Description
    NativeArray<SimpleVertex> destVertices
    NativeArray<UInt16> destIndices
    float3 org
    float3 du
    float3 dv
    AABB bb

    FillPlaneMeshLit(NativeArray<LitVertex>, NativeArray<UInt16>, float3, float3, float3, out AABB)

    Declaration
    public static void FillPlaneMeshLit(NativeArray<LitVertex> destVertices, NativeArray<ushort> destIndices, float3 org, float3 du, float3 dv, out AABB bb)
    Parameters
    Type Name Description
    NativeArray<LitVertex> destVertices
    NativeArray<UInt16> destIndices
    float3 org
    float3 du
    float3 dv
    AABB bb

    FillSuperTorusKnot(NativeArray<LitVertex>, NativeArray<UInt16>, Single, Int32, Single, Int32, Int32, Int32, Single, Single)

    Declaration
    public static void FillSuperTorusKnot(NativeArray<LitVertex> vertices, NativeArray<ushort> indices, float innerR, int innerN, float outerR, int outerN, int p, int q, float innerE, float outerE)
    Parameters
    Type Name Description
    NativeArray<LitVertex> vertices
    NativeArray<UInt16> indices
    Single innerR
    Int32 innerN
    Single outerR
    Int32 outerN
    Int32 p
    Int32 q
    Single innerE
    Single outerE

    InitCatmullRom(float3, float3, float3, float3)

    Declaration
    public static float3x4 InitCatmullRom(float3 p0, float3 p1, float3 p2, float3 p3)
    Parameters
    Type Name Description
    float3 p0
    float3 p1
    float3 p2
    float3 p3
    Returns
    Type Description
    float3x4

    ResampleCatmullRom(NativeArray<float3>, Single, Boolean, Allocator)

    Declaration
    public static NativeList<float3> ResampleCatmullRom(NativeArray<float3> curve, float stepDistance, bool closed, Allocator allocator)
    Parameters
    Type Name Description
    NativeArray<float3> curve
    Single stepDistance
    Boolean closed
    Allocator allocator
    Returns
    Type Description
    NativeList<float3>

    ResampleLinear(NativeArray<float3>, Single, Allocator)

    Declaration
    public static NativeList<float3> ResampleLinear(NativeArray<float3> curve, float stepDistance, Allocator allocator)
    Parameters
    Type Name Description
    NativeArray<float3> curve
    Single stepDistance
    Allocator allocator
    Returns
    Type Description
    NativeList<float3>

    SampleNativeArrayUniformLinear(NativeArray<Single>, Single)

    Declaration
    public static float SampleNativeArrayUniformLinear(NativeArray<float> arr, float t)
    Parameters
    Type Name Description
    NativeArray<Single> arr
    Single t
    Returns
    Type Description
    Single

    SetAlbedoColor(NativeArray<LitVertex>, float4)

    Declaration
    public static void SetAlbedoColor(NativeArray<LitVertex> dest, float4 albedo_opacity)
    Parameters
    Type Name Description
    NativeArray<LitVertex> dest
    float4 albedo_opacity

    SetMetalSmoothness(NativeArray<LitVertex>, float2)

    Declaration
    public static void SetMetalSmoothness(NativeArray<LitVertex> dest, float2 metal_smoothness)
    Parameters
    Type Name Description
    NativeArray<LitVertex> dest
    float2 metal_smoothness

    SmoothCurve(NativeArray<float3>)

    Declaration
    public static void SmoothCurve(NativeArray<float3> curve)
    Parameters
    Type Name Description
    NativeArray<float3> curve
    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