RSX Code Reference
    Preparing search index...
    • rsx
    • NetReplicateOptions

    Interface NetReplicateOptions<T>

    Options for netReplicate decorator with type-safe compareFn.

    interface NetReplicateOptions<T = any> {
        compareFn?: (lhs: T, rhs: T) => number;
        positionThreshold?: number;
        rotationThreshold?: number;
        threshold?: number;
    }

    Type Parameters

    • T = any
    Index
    compareFn?: (lhs: T, rhs: T) => number

    Custom comparison function for complex types. Returns the "difference" magnitude between two values. If provided, overrides default comparison for this field.

    (lhs, rhs) => Math.abs(lhs.customValue - rhs.customValue)
    
    positionThreshold?: number

    Position threshold for Vector2/3/4 fields. undefined = use default.

    rotationThreshold?: number

    Rotation threshold for Quaternion fields (radians). undefined = use default.

    threshold?: number

    General threshold for float/double/int fields. undefined = use default.