Skip to content

クラス GcCollisionExtensions

Namespace: GameCanvas

csharp
public static class GcCollisionExtensions

メソッド

CalcDistance(GcLine, float2)

csharp
public static float CalcDistance(this in GcLine self, in float2 point)

線と点との距離を求めます

パラメーター

  • self — 線
  • point — 点

戻り値

線と点との距離

Contains(GcAABB, float2)

csharp
public static bool Contains(this in GcAABB self, in float2 point)

点が矩形と重なっているかどうかを調べます

パラメーター

  • self — 矩形
  • point — 点

戻り値

重なっているかどうか

Contains(GcCircle, float2)

csharp
public static bool Contains(this in GcCircle self, in float2 point)

点が円と重なっているかどうかを調べます

パラメーター

  • self — 円
  • point — 点

戻り値

重なっているかどうか

Contains(GcLine, float2)

csharp
public static bool Contains(this in GcLine self, in float2 point)

点が線上に存在するかどうかを調べます

パラメーター

  • self — 線
  • point — 点

戻り値

存在するかどうか

HitTest(GcAABB, float2, GcHitResult)

csharp
public static bool HitTest(this in GcAABB self, in float2 point, out GcHitResult hit)

点と矩形の衝突判定を行い、詳細な衝突点情報を計算します

パラメーター

  • self — 矩形
  • point — 点
  • hit — 衝突点情報

戻り値

衝突しているかどうか

HitTest(GcAABB, GcAABB, GcHitResult)

csharp
public static bool HitTest(this in GcAABB self, GcAABB other, out GcHitResult hit)

矩形同士の衝突判定を行い、詳細な衝突点情報を計算します

パラメーター

  • self — 矩形1
  • other — 矩形2
  • hit — 衝突点情報

戻り値

衝突しているかどうか

Intersects(GcLine, GcLine, float2)

csharp
public static bool Intersects(this in GcLine self, in GcLine other, out float2 intersection)

線同士が交差しているかどうかを調べます

パラメーター

  • self — 線1
  • other — 線2
  • intersection — 交差座標

戻り値

交差しているかどうか

Intersects(GcLine, GcLine)

csharp
public static bool Intersects(this in GcLine self, in GcLine other)

線同士が交差しているかどうかを調べます

パラメーター

  • self — 線1
  • other — 線2

戻り値

交差しているかどうか

Overlaps(GcAABB, GcAABB)

csharp
public static bool Overlaps(this in GcAABB self, in GcAABB other)

矩形同士が重なっているかどうかを調べます

パラメーター

  • self — 矩形1
  • other — 矩形2

戻り値

重なっているかどうか

Overlaps(GcCircle, GcCircle)

csharp
public static bool Overlaps(this in GcCircle self, in GcCircle other)

円同士が重なっているかどうかを調べます

パラメーター

  • self — 円1
  • other — 円2

戻り値

重なっているかどうか

SweepTest(GcAABB, float2, float2, GcSweepResult)

csharp
public static bool SweepTest(this in GcAABB @static, in float2 @dynamic, in float2 delta, out GcSweepResult sweep)

移動量を考慮した 矩形と点の衝突判定を行います

パラメーター

  • static — 静止している矩形
  • dynamic — 移動する点
  • delta — 点の移動量
  • sweep — 衝突情報

戻り値

衝突するかどうか

SweepTest(GcAABB, GcAABB, float2, GcSweepResult)

csharp
public static bool SweepTest(this in GcAABB @static, in GcAABB @dynamic, in float2 delta, out GcSweepResult sweep)

移動量を考慮した 矩形同士の衝突判定を行います

パラメーター

  • static — 静止している矩形
  • dynamic — 移動する矩形
  • delta — 矩形の移動量
  • sweep — 衝突情報

戻り値

衝突するかどうか

Released under the MIT License.