mirror of
https://github.com/godotengine/godot.git
synced 2025-10-20 00:13:30 +00:00
Added lerp_angles built-in function
Co-authored-by: Xrayez <https://github.com/Xrayez> Co-authored-by: DleanJeans <https://github.com/DleanJeans>
This commit is contained in:
parent
c317a3ce16
commit
6694c119d0
10 changed files with 84 additions and 10 deletions
|
@ -76,6 +76,7 @@ const char *GDScriptFunctions::get_func_name(Function p_func) {
|
|||
"step_decimals",
|
||||
"stepify",
|
||||
"lerp",
|
||||
"lerp_angle",
|
||||
"inverse_lerp",
|
||||
"range_lerp",
|
||||
"smoothstep",
|
||||
|
@ -383,6 +384,13 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_
|
|||
} break;
|
||||
}
|
||||
} break;
|
||||
case MATH_LERP_ANGLE: {
|
||||
VALIDATE_ARG_COUNT(3);
|
||||
VALIDATE_ARG_NUM(0);
|
||||
VALIDATE_ARG_NUM(1);
|
||||
VALIDATE_ARG_NUM(2);
|
||||
r_ret = Math::lerp_angle((double)*p_args[0], (double)*p_args[1], (double)*p_args[2]);
|
||||
} break;
|
||||
case MATH_INVERSE_LERP: {
|
||||
VALIDATE_ARG_COUNT(3);
|
||||
VALIDATE_ARG_NUM(0);
|
||||
|
@ -1676,6 +1684,11 @@ MethodInfo GDScriptFunctions::get_info(Function p_func) {
|
|||
mi.return_val.usage |= PROPERTY_USAGE_NIL_IS_VARIANT;
|
||||
return mi;
|
||||
} break;
|
||||
case MATH_LERP_ANGLE: {
|
||||
MethodInfo mi("lerp_angle", PropertyInfo(Variant::REAL, "from"), PropertyInfo(Variant::REAL, "to"), PropertyInfo(Variant::REAL, "weight"));
|
||||
mi.return_val.type = Variant::REAL;
|
||||
return mi;
|
||||
} break;
|
||||
case MATH_INVERSE_LERP: {
|
||||
MethodInfo mi("inverse_lerp", PropertyInfo(Variant::REAL, "from"), PropertyInfo(Variant::REAL, "to"), PropertyInfo(Variant::REAL, "weight"));
|
||||
mi.return_val.type = Variant::REAL;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue