diff --git a/core/variant_call.cpp b/core/variant_call.cpp index 06d15771d..3ca52d292 100644 --- a/core/variant_call.cpp +++ b/core/variant_call.cpp @@ -418,40 +418,50 @@ struct _VariantCall { r_ret = retval; } - VCALL_LOCALMEM1R(Vector2, distance_to); - VCALL_LOCALMEM1R(Vector2, distance_squared_to); - VCALL_LOCALMEM0R(Vector2, length); - VCALL_LOCALMEM0R(Vector2, length_squared); + VCALL_LOCALMEM1(Vector2, set_all); + VCALL_LOCALMEM0R(Vector2, min_axis); + VCALL_LOCALMEM0R(Vector2, max_axis); + VCALL_LOCALMEM0(Vector2, normalize); VCALL_LOCALMEM0R(Vector2, normalized); VCALL_LOCALMEM0R(Vector2, is_normalized); - VCALL_LOCALMEM1R(Vector2, is_equal_approx); - VCALL_LOCALMEM1R(Vector2, posmod); - VCALL_LOCALMEM1R(Vector2, posmodv); - VCALL_LOCALMEM1R(Vector2, project); + VCALL_LOCALMEM0R(Vector2, length); + VCALL_LOCALMEM0R(Vector2, length_squared); + VCALL_LOCALMEM1R(Vector2, limit_length); + VCALL_LOCALMEM1R(Vector2, min); + VCALL_LOCALMEM1R(Vector2, max); + VCALL_LOCALMEM1R(Vector2, distance_to); + VCALL_LOCALMEM1R(Vector2, distance_squared_to); VCALL_LOCALMEM1R(Vector2, angle_to); VCALL_LOCALMEM1R(Vector2, angle_to_point); VCALL_LOCALMEM1R(Vector2, direction_to); + VCALL_LOCALMEM1R(Vector2, dot); + VCALL_LOCALMEM1R(Vector2, cross); + VCALL_LOCALMEM1R(Vector2, posmod); + VCALL_LOCALMEM1R(Vector2, posmodv); + VCALL_LOCALMEM1R(Vector2, project); + VCALL_LOCALMEM2R(Vector2, plane_project); + VCALL_LOCALMEM1R(Vector2, clamped); VCALL_LOCALMEM2R(Vector2, linear_interpolate); VCALL_LOCALMEM2R(Vector2, slerp); VCALL_LOCALMEM4R(Vector2, cubic_interpolate); + VCALL_LOCALMEM4R(Vector2, bezier_interpolate); VCALL_LOCALMEM2R(Vector2, move_toward); + VCALL_LOCALMEM1R(Vector2, slide); + VCALL_LOCALMEM1R(Vector2, bounce); + VCALL_LOCALMEM1R(Vector2, reflect); + VCALL_LOCALMEM1R(Vector2, is_equal_approx); + VCALL_LOCALMEM0R(Vector2, angle); + VCALL_LOCALMEM1(Vector2, set_rotation); + VCALL_LOCALMEM0R(Vector2, abs); VCALL_LOCALMEM1R(Vector2, rotated); VCALL_LOCALMEM0R(Vector2, tangent); + VCALL_LOCALMEM0R(Vector2, orthogonal); + VCALL_LOCALMEM0R(Vector2, sign); VCALL_LOCALMEM0R(Vector2, floor); VCALL_LOCALMEM0R(Vector2, ceil); VCALL_LOCALMEM0R(Vector2, round); VCALL_LOCALMEM1R(Vector2, snapped); VCALL_LOCALMEM0R(Vector2, aspect); - VCALL_LOCALMEM1R(Vector2, dot); - VCALL_LOCALMEM1R(Vector2, slide); - VCALL_LOCALMEM1R(Vector2, bounce); - VCALL_LOCALMEM1R(Vector2, reflect); - VCALL_LOCALMEM0R(Vector2, angle); - VCALL_LOCALMEM1R(Vector2, cross); - VCALL_LOCALMEM0R(Vector2, abs); - VCALL_LOCALMEM1R(Vector2, clamped); - VCALL_LOCALMEM1R(Vector2, limit_length); - VCALL_LOCALMEM0R(Vector2, sign); VCALL_LOCALMEM2R(Vector2i, linear_interpolate); @@ -2233,40 +2243,50 @@ void register_variant_methods() { ADDFUNC0R(STRING, POOL_BYTE_ARRAY, String, to_utf8, varray()); ADDFUNC0R(STRING, POOL_BYTE_ARRAY, String, to_wchar, varray()); - ADDFUNC0R(VECTOR2, REAL, Vector2, angle, varray()); + ADDFUNC1(VECTOR2, NIL, Vector2, set_all, REAL, "value", varray()); + ADDFUNC0R(VECTOR2, INT, Vector2, min_axis, varray()); + ADDFUNC0R(VECTOR2, INT, Vector2, max_axis, varray()); + ADDFUNC0(VECTOR2, NIL, Vector2, normalize, varray()); + ADDFUNC0R(VECTOR2, VECTOR2, Vector2, normalized, varray()); + ADDFUNC0R(VECTOR2, BOOL, Vector2, is_normalized, varray()); + ADDFUNC0R(VECTOR2, REAL, Vector2, length, varray()); + ADDFUNC0R(VECTOR2, REAL, Vector2, length_squared, varray()); + ADDFUNC1R(VECTOR2, VECTOR2, Vector2, limit_length, REAL, "length", varray(1.0)); + ADDFUNC1R(VECTOR2, VECTOR2, Vector2, min, VECTOR2, "vector2", varray()); + ADDFUNC1R(VECTOR2, VECTOR2, Vector2, max, VECTOR2, "vector2", varray()); + ADDFUNC1R(VECTOR2, REAL, Vector2, distance_to, VECTOR2, "to", varray()); + ADDFUNC1R(VECTOR2, REAL, Vector2, distance_squared_to, VECTOR2, "to", varray()); ADDFUNC1R(VECTOR2, REAL, Vector2, angle_to, VECTOR2, "to", varray()); ADDFUNC1R(VECTOR2, REAL, Vector2, angle_to_point, VECTOR2, "to", varray()); ADDFUNC1R(VECTOR2, VECTOR2, Vector2, direction_to, VECTOR2, "b", varray()); - ADDFUNC1R(VECTOR2, REAL, Vector2, distance_to, VECTOR2, "to", varray()); - ADDFUNC1R(VECTOR2, REAL, Vector2, distance_squared_to, VECTOR2, "to", varray()); - ADDFUNC0R(VECTOR2, REAL, Vector2, length, varray()); - ADDFUNC0R(VECTOR2, REAL, Vector2, length_squared, varray()); - ADDFUNC0R(VECTOR2, VECTOR2, Vector2, normalized, varray()); - ADDFUNC0R(VECTOR2, BOOL, Vector2, is_normalized, varray()); - ADDFUNC1R(VECTOR2, BOOL, Vector2, is_equal_approx, VECTOR2, "v", varray()); + ADDFUNC1R(VECTOR2, REAL, Vector2, dot, VECTOR2, "with", varray()); + ADDFUNC1R(VECTOR2, REAL, Vector2, cross, VECTOR2, "with", varray()); ADDFUNC1R(VECTOR2, VECTOR2, Vector2, posmod, REAL, "mod", varray()); ADDFUNC1R(VECTOR2, VECTOR2, Vector2, posmodv, VECTOR2, "modv", varray()); ADDFUNC1R(VECTOR2, VECTOR2, Vector2, project, VECTOR2, "b", varray()); + ADDFUNC2R(VECTOR2, VECTOR2, Vector2, plane_project, REAL, "d", VECTOR2, "vec", varray()); + ADDFUNC1R(VECTOR2, VECTOR2, Vector2, clamped, REAL, "length", varray()); ADDFUNC2R(VECTOR2, VECTOR2, Vector2, linear_interpolate, VECTOR2, "to", REAL, "weight", varray()); ADDFUNC2R(VECTOR2, VECTOR2, Vector2, slerp, VECTOR2, "to", REAL, "weight", varray()); ADDFUNC4R(VECTOR2, VECTOR2, Vector2, cubic_interpolate, VECTOR2, "b", VECTOR2, "pre_a", VECTOR2, "post_b", REAL, "weight", varray()); + ADDFUNC4R(VECTOR2, VECTOR2, Vector2, bezier_interpolate, VECTOR2, "b", VECTOR2, "pre_a", VECTOR2, "post_b", REAL, "weight", varray()); ADDFUNC2R(VECTOR2, VECTOR2, Vector2, move_toward, VECTOR2, "to", REAL, "delta", varray()); + ADDFUNC1R(VECTOR2, VECTOR2, Vector2, slide, VECTOR2, "n", varray()); + ADDFUNC1R(VECTOR2, VECTOR2, Vector2, bounce, VECTOR2, "n", varray()); + ADDFUNC1R(VECTOR2, VECTOR2, Vector2, reflect, VECTOR2, "n", varray()); + ADDFUNC1R(VECTOR2, BOOL, Vector2, is_equal_approx, VECTOR2, "v", varray()); + ADDFUNC0R(VECTOR2, REAL, Vector2, angle, varray()); + ADDFUNC1(VECTOR2, NIL, Vector2, set_rotation, REAL, "radians", varray()); + ADDFUNC0R(VECTOR2, VECTOR2, Vector2, abs, varray()); ADDFUNC1R(VECTOR2, VECTOR2, Vector2, rotated, REAL, "phi", varray()); ADDFUNC0R(VECTOR2, VECTOR2, Vector2, tangent, varray()); + ADDFUNC0R(VECTOR2, VECTOR2, Vector2, orthogonal, varray()); + ADDFUNC0R(VECTOR2, VECTOR2, Vector2, sign, varray()); ADDFUNC0R(VECTOR2, VECTOR2, Vector2, floor, varray()); ADDFUNC0R(VECTOR2, VECTOR2, Vector2, ceil, varray()); ADDFUNC0R(VECTOR2, VECTOR2, Vector2, round, varray()); ADDFUNC1R(VECTOR2, VECTOR2, Vector2, snapped, VECTOR2, "by", varray()); ADDFUNC0R(VECTOR2, REAL, Vector2, aspect, varray()); - ADDFUNC1R(VECTOR2, REAL, Vector2, dot, VECTOR2, "with", varray()); - ADDFUNC1R(VECTOR2, VECTOR2, Vector2, slide, VECTOR2, "n", varray()); - ADDFUNC1R(VECTOR2, VECTOR2, Vector2, bounce, VECTOR2, "n", varray()); - ADDFUNC1R(VECTOR2, VECTOR2, Vector2, reflect, VECTOR2, "n", varray()); - ADDFUNC1R(VECTOR2, REAL, Vector2, cross, VECTOR2, "with", varray()); - ADDFUNC0R(VECTOR2, VECTOR2, Vector2, abs, varray()); - ADDFUNC1R(VECTOR2, VECTOR2, Vector2, clamped, REAL, "length", varray()); - ADDFUNC1R(VECTOR2, VECTOR2, Vector2, limit_length, REAL, "length", varray(1.0)); - ADDFUNC0R(VECTOR2, VECTOR2, Vector2, sign, varray()); ADDFUNC2R(VECTOR2I, VECTOR2I, Vector2i, linear_interpolate, VECTOR2, "to", REAL, "weight", varray());