For AI agents: the complete documentation index is available at /en/llms.txt, the full documentation bundle is available at /en/llms-full.txt, and this page is available as Markdown at /en/reference/sdk/sapi/runtime/functions/getBase.md.
  • English
  • Function: getBase()

    function getBase(direction: number): [number, number];

    Defined in: sapi/runtime/tools.ts:63

    将方向码映射为二维水平单位向量 [dx, dz]。

    方向映射规则:

    • 1:东(+X)[1, 0]
    • -1:西(-X)[-1, 0]
    • 2:南(+Z)[0, 1]
    • -2:北(-Z)[0, -1]

    Parameters

    ParameterTypeDescription
    directionnumber方向代号。

    Returns

    [number, number]

    二维平面步进向量。