Project290.Physics.Collision.Shapes.CircleShape.TestPoint C# (CSharp) Method

TestPoint() public method

Test a point for containment in this shape. This only works for convex shapes.
public TestPoint ( Transform &transform, Vector2 &point ) : bool
transform Transform The shape world transform.
point Vector2 a point in world coordinates.
return bool
        public override bool TestPoint(ref Transform transform, ref Vector2 point)
        {
            Vector2 center = transform.Position + MathUtils.Multiply(ref transform.R, Position);
            Vector2 d = point - center;
            return Vector2.Dot(d, d) <= Radius*Radius;
        }