Class GcCollisionExtensions
Inheritance
System.Object
GcCollisionExtensions
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: GameCanvas
Assembly: GameCanvas.dll
Syntax
public static class GcCollisionExtensions
Methods
CalcDistance(GcLine, float2)
線と点との距離を求めます
Declaration
public static float CalcDistance(this in GcLine self, in float2 point)
Parameters
Type | Name | Description |
---|---|---|
GcLine | self | 線 |
float2 | point | 点 |
Returns
Type | Description |
---|---|
Single | 線と点との距離 |
Contains(GcAABB, float2)
点が矩形と重なっているかどうかを調べます
Declaration
public static bool Contains(this in GcAABB self, in float2 point)
Parameters
Type | Name | Description |
---|---|---|
GcAABB | self | 矩形 |
float2 | point | 点 |
Returns
Type | Description |
---|---|
Boolean | 重なっているかどうか |
Contains(GcCircle, float2)
点が円と重なっているかどうかを調べます
Declaration
public static bool Contains(this in GcCircle self, in float2 point)
Parameters
Type | Name | Description |
---|---|---|
GcCircle | self | 円 |
float2 | point | 点 |
Returns
Type | Description |
---|---|
Boolean | 重なっているかどうか |
Contains(GcLine, float2)
点が線上に存在するかどうかを調べます
Declaration
public static bool Contains(this in GcLine self, in float2 point)
Parameters
Type | Name | Description |
---|---|---|
GcLine | self | 線 |
float2 | point | 点 |
Returns
Type | Description |
---|---|
Boolean | 存在するかどうか |
HitTest(GcAABB, GcAABB, out GcHitResult)
矩形同士の衝突判定を行い、詳細な衝突点情報を計算します
Declaration
public static bool HitTest(this in GcAABB self, GcAABB other, out GcHitResult hit)
Parameters
Type | Name | Description |
---|---|---|
GcAABB | self | 矩形1 |
GcAABB | other | 矩形2 |
GcHitResult | hit | 衝突点情報 |
Returns
Type | Description |
---|---|
Boolean | 衝突しているかどうか |
HitTest(GcAABB, float2, out GcHitResult)
点と矩形の衝突判定を行い、詳細な衝突点情報を計算します
Declaration
public static bool HitTest(this in GcAABB self, in float2 point, out GcHitResult hit)
Parameters
Type | Name | Description |
---|---|---|
GcAABB | self | 矩形 |
float2 | point | 点 |
GcHitResult | hit | 衝突点情報 |
Returns
Type | Description |
---|---|
Boolean | 衝突しているかどうか |
Intersects(GcLine, GcLine)
線同士が交差しているかどうかを調べます
Declaration
public static bool Intersects(this in GcLine self, in GcLine other)
Parameters
Type | Name | Description |
---|---|---|
GcLine | self | 線1 |
GcLine | other | 線2 |
Returns
Type | Description |
---|---|
Boolean | 交差しているかどうか |
Intersects(GcLine, GcLine, out float2)
線同士が交差しているかどうかを調べます
Declaration
public static bool Intersects(this in GcLine self, in GcLine other, out float2 intersection)
Parameters
Type | Name | Description |
---|---|---|
GcLine | self | 線1 |
GcLine | other | 線2 |
float2 | intersection | 交差座標 |
Returns
Type | Description |
---|---|
Boolean | 交差しているかどうか |
Overlaps(GcAABB, GcAABB)
矩形同士が重なっているかどうかを調べます
Declaration
public static bool Overlaps(this in GcAABB self, in GcAABB other)
Parameters
Type | Name | Description |
---|---|---|
GcAABB | self | 矩形1 |
GcAABB | other | 矩形2 |
Returns
Type | Description |
---|---|
Boolean | 重なっているかどうか |
Overlaps(GcCircle, GcCircle)
円同士が重なっているかどうかを調べます
Declaration
public static bool Overlaps(this in GcCircle self, in GcCircle other)
Parameters
Type | Name | Description |
---|---|---|
GcCircle | self | 円1 |
GcCircle | other | 円2 |
Returns
Type | Description |
---|---|
Boolean | 重なっているかどうか |
SweepTest(GcAABB, GcAABB, float2, out GcSweepResult)
移動量を考慮した 矩形同士の衝突判定を行います
Declaration
public static bool SweepTest(this in GcAABB static, in GcAABB dynamic, in float2 delta, out GcSweepResult sweep)
Parameters
Type | Name | Description |
---|---|---|
GcAABB | static | 静止している矩形 |
GcAABB | dynamic | 移動する矩形 |
float2 | delta | 矩形の移動量 |
GcSweepResult | sweep | 衝突情報 |
Returns
Type | Description |
---|---|
Boolean | 衝突するかどうか |
SweepTest(GcAABB, float2, float2, out GcSweepResult)
移動量を考慮した 矩形と点の衝突判定を行います
Declaration
public static bool SweepTest(this in GcAABB static, in float2 dynamic, in float2 delta, out GcSweepResult sweep)
Parameters
Type | Name | Description |
---|---|---|
GcAABB | static | 静止している矩形 |
float2 | dynamic | 移動する点 |
float2 | delta | 点の移動量 |
GcSweepResult | sweep | 衝突情報 |
Returns
Type | Description |
---|---|
Boolean | 衝突するかどうか |