Dynamic Water Physics 2
Search Results for

    Show / Hide Table of Contents

    Class MeshDecimate

    Progressive mesh decimation implementation using edge collapse algorithm. Reduces mesh complexity while preserving overall shape and texture coordinates.

    Inheritance
    object
    MeshDecimate
    Namespace: NWH.DWP2.MeshDecimation
    Assembly: NWH.DWP2.dll
    Syntax
    public class MeshDecimate

    Fields

    | Edit this page View Source

    bRecalculateNormals

    Whether to recalculate smooth normals after decimation.

    Declaration
    public bool bRecalculateNormals
    Field Value
    Type Description
    bool
    | Edit this page View Source

    finalNormals

    Final vertex normals after decimation.

    Declaration
    public Vector3[] finalNormals
    Field Value
    Type Description
    Vector3[]
    | Edit this page View Source

    finalTriangles

    Final triangle indices after decimation.

    Declaration
    public int[] finalTriangles
    Field Value
    Type Description
    int[]
    | Edit this page View Source

    finalUVs

    Final texture coordinates after decimation.

    Declaration
    public Vector2[] finalUVs
    Field Value
    Type Description
    Vector2[]
    | Edit this page View Source

    finalVertices

    Final vertex positions after decimation.

    Declaration
    public Vector3[] finalVertices
    Field Value
    Type Description
    Vector3[]
    | Edit this page View Source

    lastTarget

    Last target vertex count from progressive mesh operation.

    Declaration
    public int lastTarget
    Field Value
    Type Description
    int
    | Edit this page View Source

    lockSelPoint

    Whether to lock selected vertices from being collapsed.

    Declaration
    public bool lockSelPoint
    Field Value
    Type Description
    bool
    | Edit this page View Source

    lodDataSize

    Size in bytes of LOD history data for progressive mesh.

    Declaration
    public float lodDataSize
    Field Value
    Type Description
    float
    | Edit this page View Source

    preCalculateDone

    Whether pre-calculation of decimation data has been completed.

    Declaration
    public bool preCalculateDone
    Field Value
    Type Description
    bool
    | Edit this page View Source

    ratio

    Target ratio of vertices to keep (0.0 to 1.0).

    Declaration
    public float ratio
    Field Value
    Type Description
    float
    | Edit this page View Source

    selectedVertices

    List of vertices marked as selected (protected from collapse if locked).

    Declaration
    public List<Vector3> selectedVertices
    Field Value
    Type Description
    List<Vector3>
    | Edit this page View Source

    smoothAngle

    Smoothing angle threshold in degrees for normal calculation.

    Declaration
    public float smoothAngle
    Field Value
    Type Description
    float

    Methods

    | Edit this page View Source

    Calculate(Mesh)

    Calculates the decimated mesh at the current ratio. Applies progressive mesh simplification and outputs final geometry arrays. PreCalculate must be called first.

    Declaration
    public void Calculate(Mesh tmpMesh)
    Parameters
    Type Name Description
    Mesh tmpMesh

    Mesh reference (used for validation).

    | Edit this page View Source

    PreCalculate(Mesh)

    Pre-calculates all edge collapse operations and builds the progressive mesh history. Must be called once before Calculate can be used.

    Declaration
    public void PreCalculate(Mesh tmpMesh)
    Parameters
    Type Name Description
    Mesh tmpMesh

    Input mesh to decimate.

    • Edit this page
    • View Source
    In this article
    Back to top Copyright © NWH - Vehicle Physics, Aerodynamics, Dynamic Water Physics