Function RigidBody2D.testMotion

Returns true if a collision would result from moving in the given vector. margin increases the size of the shapes involved in the collision detection, and result is an object of type Physics2DTestMotionResult, which contains additional information about the collision (should there be one).

bool testMotion (
  const(Vector2) motion,
  const(bool) infinite_inertia = true,
  const(double) margin = 0.08,
  Physics2DTestMotionResult result = Physics2DTestMotionResult(godot_object(null), )
) nothrow @nogc;