diff options
author | Aaron Franke <arnfranke@yahoo.com> | 2020-03-16 05:07:33 -0400 |
---|---|---|
committer | Aaron Franke <arnfranke@yahoo.com> | 2020-04-29 04:02:49 -0400 |
commit | 540156b387270215f513a68b1cf9ffc909ac381b (patch) | |
tree | e5c7f89c9c70294dd1a5aac5461fbb9170868578 /modules | |
parent | ad3c3e1bbbdbf47fca6d775e01867820040d84f1 (diff) |
[Core] Rename linear_interpolate to lerp
Diffstat (limited to 'modules')
-rw-r--r-- | modules/csg/csg.cpp | 2 | ||||
-rw-r--r-- | modules/gdnative/gdnative/color.cpp | 4 | ||||
-rw-r--r-- | modules/gdnative/gdnative/vector2.cpp | 4 | ||||
-rw-r--r-- | modules/gdnative/gdnative/vector3.cpp | 4 | ||||
-rw-r--r-- | modules/gdnative/gdnative_api.json | 6 | ||||
-rw-r--r-- | modules/gdnative/include/gdnative/color.h | 2 | ||||
-rw-r--r-- | modules/gdnative/include/gdnative/vector2.h | 2 | ||||
-rw-r--r-- | modules/gdnative/include/gdnative/vector3.h | 2 | ||||
-rw-r--r-- | modules/gdscript/doc_classes/@GDScript.xml | 2 | ||||
-rw-r--r-- | modules/gdscript/gdscript_functions.cpp | 6 |
10 files changed, 17 insertions, 17 deletions
diff --git a/modules/csg/csg.cpp b/modules/csg/csg.cpp index 3f61e2852f..6714db76bb 100644 --- a/modules/csg/csg.cpp +++ b/modules/csg/csg.cpp @@ -50,7 +50,7 @@ inline static Vector2 interpolate_segment_uv(const Vector2 p_segement_points[2], float distance = (p_interpolation_point - p_segement_points[0]).length(); float fraction = distance / segment_length; - return p_uvs[0].linear_interpolate(p_uvs[1], fraction); + return p_uvs[0].lerp(p_uvs[1], fraction); } inline static Vector2 interpolate_triangle_uv(const Vector2 p_vertices[3], const Vector2 p_uvs[3], const Vector2 &p_interpolation_point) { diff --git a/modules/gdnative/gdnative/color.cpp b/modules/gdnative/gdnative/color.cpp index 914d5b03f4..68c83e05a6 100644 --- a/modules/gdnative/gdnative/color.cpp +++ b/modules/gdnative/gdnative/color.cpp @@ -155,11 +155,11 @@ godot_color GDAPI godot_color_contrasted(const godot_color *p_self) { return dest; } -godot_color GDAPI godot_color_linear_interpolate(const godot_color *p_self, const godot_color *p_b, const godot_real p_t) { +godot_color GDAPI godot_color_lerp(const godot_color *p_self, const godot_color *p_b, const godot_real p_t) { godot_color dest; const Color *self = (const Color *)p_self; const Color *b = (const Color *)p_b; - *((Color *)&dest) = self->linear_interpolate(*b, p_t); + *((Color *)&dest) = self->lerp(*b, p_t); return dest; } diff --git a/modules/gdnative/gdnative/vector2.cpp b/modules/gdnative/gdnative/vector2.cpp index e9e2a8edf8..dc273e7951 100644 --- a/modules/gdnative/gdnative/vector2.cpp +++ b/modules/gdnative/gdnative/vector2.cpp @@ -109,11 +109,11 @@ godot_real GDAPI godot_vector2_angle_to_point(const godot_vector2 *p_self, const return self->angle_to_point(*to); } -godot_vector2 GDAPI godot_vector2_linear_interpolate(const godot_vector2 *p_self, const godot_vector2 *p_b, const godot_real p_t) { +godot_vector2 GDAPI godot_vector2_lerp(const godot_vector2 *p_self, const godot_vector2 *p_b, const godot_real p_t) { godot_vector2 dest; const Vector2 *self = (const Vector2 *)p_self; const Vector2 *b = (const Vector2 *)p_b; - *((Vector2 *)&dest) = self->linear_interpolate(*b, p_t); + *((Vector2 *)&dest) = self->lerp(*b, p_t); return dest; } diff --git a/modules/gdnative/gdnative/vector3.cpp b/modules/gdnative/gdnative/vector3.cpp index e34a9370a5..bb27ad5a00 100644 --- a/modules/gdnative/gdnative/vector3.cpp +++ b/modules/gdnative/gdnative/vector3.cpp @@ -106,11 +106,11 @@ godot_vector3 GDAPI godot_vector3_rotated(const godot_vector3 *p_self, const god return dest; } -godot_vector3 GDAPI godot_vector3_linear_interpolate(const godot_vector3 *p_self, const godot_vector3 *p_b, const godot_real p_t) { +godot_vector3 GDAPI godot_vector3_lerp(const godot_vector3 *p_self, const godot_vector3 *p_b, const godot_real p_t) { godot_vector3 dest; const Vector3 *self = (const Vector3 *)p_self; const Vector3 *b = (const Vector3 *)p_b; - *((Vector3 *)&dest) = self->linear_interpolate(*b, p_t); + *((Vector3 *)&dest) = self->lerp(*b, p_t); return dest; } diff --git a/modules/gdnative/gdnative_api.json b/modules/gdnative/gdnative_api.json index 9473a3d419..d5ab62dc61 100644 --- a/modules/gdnative/gdnative_api.json +++ b/modules/gdnative/gdnative_api.json @@ -586,7 +586,7 @@ ] }, { - "name": "godot_color_linear_interpolate", + "name": "godot_color_lerp", "return_type": "godot_color", "arguments": [ ["const godot_color *", "p_self"], @@ -710,7 +710,7 @@ ] }, { - "name": "godot_vector2_linear_interpolate", + "name": "godot_vector2_lerp", "return_type": "godot_vector2", "arguments": [ ["const godot_vector2 *", "p_self"], @@ -1449,7 +1449,7 @@ ] }, { - "name": "godot_vector3_linear_interpolate", + "name": "godot_vector3_lerp", "return_type": "godot_vector3", "arguments": [ ["const godot_vector3 *", "p_self"], diff --git a/modules/gdnative/include/gdnative/color.h b/modules/gdnative/include/gdnative/color.h index 47c01dbb20..e7737bf8e1 100644 --- a/modules/gdnative/include/gdnative/color.h +++ b/modules/gdnative/include/gdnative/color.h @@ -95,7 +95,7 @@ godot_color GDAPI godot_color_inverted(const godot_color *p_self); godot_color GDAPI godot_color_contrasted(const godot_color *p_self); -godot_color GDAPI godot_color_linear_interpolate(const godot_color *p_self, const godot_color *p_b, const godot_real p_t); +godot_color GDAPI godot_color_lerp(const godot_color *p_self, const godot_color *p_b, const godot_real p_t); godot_color GDAPI godot_color_blend(const godot_color *p_self, const godot_color *p_over); diff --git a/modules/gdnative/include/gdnative/vector2.h b/modules/gdnative/include/gdnative/vector2.h index 15a1a6063b..c11e23a586 100644 --- a/modules/gdnative/include/gdnative/vector2.h +++ b/modules/gdnative/include/gdnative/vector2.h @@ -81,7 +81,7 @@ godot_real GDAPI godot_vector2_angle_to(const godot_vector2 *p_self, const godot godot_real GDAPI godot_vector2_angle_to_point(const godot_vector2 *p_self, const godot_vector2 *p_to); -godot_vector2 GDAPI godot_vector2_linear_interpolate(const godot_vector2 *p_self, const godot_vector2 *p_b, const godot_real p_t); +godot_vector2 GDAPI godot_vector2_lerp(const godot_vector2 *p_self, const godot_vector2 *p_b, const godot_real p_t); godot_vector2 GDAPI godot_vector2_cubic_interpolate(const godot_vector2 *p_self, const godot_vector2 *p_b, const godot_vector2 *p_pre_a, const godot_vector2 *p_post_b, const godot_real p_t); diff --git a/modules/gdnative/include/gdnative/vector3.h b/modules/gdnative/include/gdnative/vector3.h index 1b344590ea..8ebf15b724 100644 --- a/modules/gdnative/include/gdnative/vector3.h +++ b/modules/gdnative/include/gdnative/vector3.h @@ -86,7 +86,7 @@ godot_vector3 GDAPI godot_vector3_snapped(const godot_vector3 *p_self, const god godot_vector3 GDAPI godot_vector3_rotated(const godot_vector3 *p_self, const godot_vector3 *p_axis, const godot_real p_phi); -godot_vector3 GDAPI godot_vector3_linear_interpolate(const godot_vector3 *p_self, const godot_vector3 *p_b, const godot_real p_t); +godot_vector3 GDAPI godot_vector3_lerp(const godot_vector3 *p_self, const godot_vector3 *p_b, const godot_real p_t); godot_vector3 GDAPI godot_vector3_cubic_interpolate(const godot_vector3 *p_self, const godot_vector3 *p_b, const godot_vector3 *p_pre_a, const godot_vector3 *p_post_b, const godot_real p_t); diff --git a/modules/gdscript/doc_classes/@GDScript.xml b/modules/gdscript/doc_classes/@GDScript.xml index 9324691df5..be159b6407 100644 --- a/modules/gdscript/doc_classes/@GDScript.xml +++ b/modules/gdscript/doc_classes/@GDScript.xml @@ -568,7 +568,7 @@ <description> Linearly interpolates between two values by a normalized value. This is the opposite of [method inverse_lerp]. If the [code]from[/code] and [code]to[/code] arguments are of type [int] or [float], the return value is a [float]. - If both are of the same vector type ([Vector2], [Vector3] or [Color]), the return value will be of the same type ([code]lerp[/code] then calls the vector type's [code]linear_interpolate[/code] method). + If both are of the same vector type ([Vector2], [Vector3] or [Color]), the return value will be of the same type ([code]lerp[/code] then calls the vector type's [code]lerp[/code] method). [codeblock] lerp(0, 4, 0.75) # Returns 3.0 lerp(Vector2(1, 5), Vector2(3, 2), 0.5) # Returns Vector2(2, 3.5) diff --git a/modules/gdscript/gdscript_functions.cpp b/modules/gdscript/gdscript_functions.cpp index 9154d6eb89..58161d6f53 100644 --- a/modules/gdscript/gdscript_functions.cpp +++ b/modules/gdscript/gdscript_functions.cpp @@ -362,13 +362,13 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_ const double t = (double)*p_args[2]; switch (p_args[0]->get_type() == p_args[1]->get_type() ? p_args[0]->get_type() : Variant::FLOAT) { case Variant::VECTOR2: { - r_ret = ((Vector2)*p_args[0]).linear_interpolate((Vector2)*p_args[1], t); + r_ret = ((Vector2)*p_args[0]).lerp((Vector2)*p_args[1], t); } break; case Variant::VECTOR3: { - r_ret = (p_args[0]->operator Vector3()).linear_interpolate(p_args[1]->operator Vector3(), t); + r_ret = (p_args[0]->operator Vector3()).lerp(p_args[1]->operator Vector3(), t); } break; case Variant::COLOR: { - r_ret = ((Color)*p_args[0]).linear_interpolate((Color)*p_args[1], t); + r_ret = ((Color)*p_args[0]).lerp((Color)*p_args[1], t); } break; default: { VALIDATE_ARG_NUM(0); |