構造体 Plane2

A plane class in 2D. [詳細]

Plane2に対する継承グラフ
ICollisionBasics

すべてのメンバ一覧

Public メソッド

 Plane2 (Vector2 a_base, Vector2 a_unit_normal)
 Plane2 constructor.
bool IsInside (Vector2 point)
 Return true if 'point' is inside the primitive (in its negative space).
void ClosestSurfacePoint (Vector2 point, out Vector2 ret, out float sign)
 Return the closest point to 'point' that lies on the surface of the primitive.
float SignedDistance (Vector2 point)
 Return the signed distance (penetration distance) from 'point' to the surface of the primitive.
Vector2 Project (Vector2 point)
 Project a point on this plane.
bool NegativeClipSegment (ref Vector2 A, ref Vector2 B)
 Assuming the primitive is convex, clip the segment AB against the primitive.

Public 変数

Vector2 Base
 A base point on the plane.
Vector2 UnitNormal
 The plane normal vector, assumed to be unit length.

説明

A plane class in 2D.


メソッド

void ClosestSurfacePoint ( Vector2  point,
out Vector2  ret,
out float  sign 
)

Return the closest point to 'point' that lies on the surface of the primitive.

If that point is inside the primitive, sign is negative.

ICollisionBasicsを実装しています。

bool NegativeClipSegment ( ref Vector2  A,
ref Vector2  B 
)

Assuming the primitive is convex, clip the segment AB against the primitive.

Return false if AB is entirely in positive halfspace, else clip against negative space and return true.

ICollisionBasicsを実装しています。


変数

The plane normal vector, assumed to be unit length.

If this is not the case, some functions will have undefined behaviour.