@esengine/nova-ecs-math - v1.0.5
    Preparing search index...

    Class FixedRect

    Rectangle using fixed-point arithmetic for deterministic calculations 使用定点算术的矩形,用于确定性计算

    Index

    Constructors

    • Create a new fixed-point rectangle 创建新的定点矩形

      Parameters

      • x: number | Fixed = 0

        X coordinate of the top-left corner

      • y: number | Fixed = 0

        Y coordinate of the top-left corner

      • width: number | Fixed = 0

        Width of the rectangle

      • height: number | Fixed = 0

        Height of the rectangle

      Returns FixedRect

    Properties

    height: Fixed
    width: Fixed
    UNIT: FixedRect = ...
    ZERO: FixedRect = ...

    Accessors

    Methods

    • Check if a point is inside this rectangle (inclusive of edges) 检查点是否在此矩形内(包含边缘)

      Parameters

      Returns boolean

    • Check if this rectangle equals another rectangle 检查此矩形是否等于另一个矩形

      Parameters

      Returns boolean

    • Check if this rectangle intersects with another rectangle 检查此矩形是否与另一个矩形相交

      Parameters

      Returns boolean

    • Check if the rectangle is empty (zero or negative area) 检查矩形是否为空(零或负面积)

      Returns boolean

    • Convert to a regular number array [x, y, width, height] 转换为普通数字数组 [x, y, width, height]

      Returns number[]

    • Convert to string representation 转换为字符串表示

      Returns string

    • Create a rectangle from an array [x, y, width, height] 从数组创建矩形 [x, y, width, height]

      Parameters

      • array: number[]

      Returns FixedRect