babylon.quarks - v0.19.0
    Preparing search index...

    Class PiecewiseBezier

    Hierarchy (View Summary)

    Implements

    Index

    Constructors

    Properties

    functions: [Bezier, number][]
    type: "function"
    TABLE_SIZE: 257

    Sample count of the table built by refreshTable.

    Accessors

    • get numOfFunctions(): number

      Returns number

    Methods

    • Drops the sampled table, so later reads go back to evaluating the curve.

      Returns void

    • Parameters

      • t: number

      Returns number

    • Evaluates the curve itself, ignoring any sampled table.

      Parameters

      • t: number

      Returns number

    • Parameters

      • index: number

      Returns number

    • Parameters

      • index: number

      Returns number

    • Rebuilds the sampled table when the curve changed, otherwise does nothing.

      Evaluating this curve means a piece lookup plus a cubic; a particle system does that once per particle per frame. Sampling it once and interpolating costs two loads and a lerp instead. Sampling error at PiecewiseBezier.TABLE_SIZE points stays around 1e-5 for the shapes a curve editor produces — far below what a colour or a size can show.

      The curve is public and mutable (a curve editor writes straight into functions and a Bezier's p), so this compares the control points against the ones the table was built from and only resamples on a real change. That is a handful of float compares per frame.

      Returns void

    • Parameters

      • index: number
      • x: number

      Returns void

    • Parameters

      Returns void

    • Parameters

      • index: number
      • x: number

      Returns void

    • Parameters

      • length: number
      • segments: number

      Returns string