Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "utils/index"

Index

Functions

rayBillboardIntersection

rayTilemapCeilingFloorIntersection

rayTilemapIntersection

  • レイとタイルマップの交差テスト。

    この関数に与えるレイとタイルマップは以下の制約がある。

    1. レイと交差するタイルが存在する。
    2. レイの方向ベクトルをXY平面に投影したベクトルが単位ベクトルの時のみ、 得られるperpendicularDistance が正しい値になる。

    Parameters

    • ray: Ray | Ray2D

      交差判定に用いるレイ。zの値は使用されない。

    • tilemap: Tilemap

      レイと交差テストするタイルマップ。

    Returns RayTilemapIntersectionResult

screenPointToRay

  • カメラ座標を始点とし、スクリーン上の一点を指す結ぶレイを生成する。

    スクリーン座標は正規化されていなければならない。たとえばスクリーン解像度 640x480 に おいて座標 16, 32 は正規化座標では 16/640, 32/480 となる。

    Parameters

    • normalizedScreenPosition: Vector2Like

      正規化スクリーン座標。

    • camera: Camera

      カメラ。

    Returns Ray

Generated using TypeDoc