#18051: Use 'var' when applicable

(cherry picked from commit fdfc478c88)
This commit is contained in:
Xavier Cho 2018-04-08 12:30:43 +09:00 committed by Hein-Pieter van Braam
parent e7b97af276
commit 31171ea5a2
14 changed files with 109 additions and 109 deletions

View File

@ -111,7 +111,7 @@ namespace Godot
public Vector3 GetLongestAxis() public Vector3 GetLongestAxis()
{ {
Vector3 axis = new Vector3(1f, 0f, 0f); var axis = new Vector3(1f, 0f, 0f);
real_t max_size = size.x; real_t max_size = size.x;
if (size.y > max_size) if (size.y > max_size)
@ -131,7 +131,7 @@ namespace Godot
public Vector3.Axis GetLongestAxisIndex() public Vector3.Axis GetLongestAxisIndex()
{ {
Vector3.Axis axis = Vector3.Axis.X; var axis = Vector3.Axis.X;
real_t max_size = size.x; real_t max_size = size.x;
if (size.y > max_size) if (size.y > max_size)
@ -164,7 +164,7 @@ namespace Godot
public Vector3 GetShortestAxis() public Vector3 GetShortestAxis()
{ {
Vector3 axis = new Vector3(1f, 0f, 0f); var axis = new Vector3(1f, 0f, 0f);
real_t max_size = size.x; real_t max_size = size.x;
if (size.y < max_size) if (size.y < max_size)
@ -184,7 +184,7 @@ namespace Godot
public Vector3.Axis GetShortestAxisIndex() public Vector3.Axis GetShortestAxisIndex()
{ {
Vector3.Axis axis = Vector3.Axis.X; var axis = Vector3.Axis.X;
real_t max_size = size.x; real_t max_size = size.x;
if (size.y < max_size) if (size.y < max_size)
@ -228,7 +228,7 @@ namespace Godot
public AABB Grow(real_t by) public AABB Grow(real_t by)
{ {
AABB res = this; var res = this;
res.position.x -= by; res.position.x -= by;
res.position.y -= by; res.position.y -= by;
@ -339,7 +339,7 @@ namespace Godot
bool over = false; bool over = false;
bool under = false; bool under = false;
for (int i = 0; i < 8; i++) for (var i = 0; i < 8; i++)
{ {
if (plane.DistanceTo(points[i]) > 0) if (plane.DistanceTo(points[i]) > 0)
over = true; over = true;
@ -355,7 +355,7 @@ namespace Godot
real_t min = 0f; real_t min = 0f;
real_t max = 1f; real_t max = 1f;
for (int i = 0; i < 3; i++) for (var i = 0; i < 3; i++)
{ {
real_t seg_from = from[i]; real_t seg_from = from[i];
real_t seg_to = to[i]; real_t seg_to = to[i];
@ -400,16 +400,16 @@ namespace Godot
{ {
Vector3 beg_1 = position; Vector3 beg_1 = position;
Vector3 beg_2 = with.position; Vector3 beg_2 = with.position;
Vector3 end_1 = new Vector3(size.x, size.y, size.z) + beg_1; var end_1 = new Vector3(size.x, size.y, size.z) + beg_1;
Vector3 end_2 = new Vector3(with.size.x, with.size.y, with.size.z) + beg_2; var end_2 = new Vector3(with.size.x, with.size.y, with.size.z) + beg_2;
Vector3 min = new Vector3( var min = new Vector3(
(beg_1.x < beg_2.x) ? beg_1.x : beg_2.x, (beg_1.x < beg_2.x) ? beg_1.x : beg_2.x,
(beg_1.y < beg_2.y) ? beg_1.y : beg_2.y, (beg_1.y < beg_2.y) ? beg_1.y : beg_2.y,
(beg_1.z < beg_2.z) ? beg_1.z : beg_2.z (beg_1.z < beg_2.z) ? beg_1.z : beg_2.z
); );
Vector3 max = new Vector3( var max = new Vector3(
(end_1.x > end_2.x) ? end_1.x : end_2.x, (end_1.x > end_2.x) ? end_1.x : end_2.x,
(end_1.y > end_2.y) ? end_1.y : end_2.y, (end_1.y > end_2.y) ? end_1.y : end_2.y,
(end_1.z > end_2.z) ? end_1.z : end_2.z (end_1.z > end_2.z) ? end_1.z : end_2.z

View File

@ -220,11 +220,11 @@ namespace Godot
public int GetOrthogonalIndex() public int GetOrthogonalIndex()
{ {
Basis orth = this; var orth = this;
for (int i = 0; i < 3; i++) for (var i = 0; i < 3; i++)
{ {
for (int j = 0; j < 3; j++) for (var j = 0; j < 3; j++)
{ {
real_t v = orth[i, j]; real_t v = orth[i, j];
@ -239,7 +239,7 @@ namespace Godot
} }
} }
for (int i = 0; i < 24; i++) for (var i = 0; i < 24; i++)
{ {
if (orthoBases[i] == orth) if (orthoBases[i] == orth)
return i; return i;
@ -250,9 +250,9 @@ namespace Godot
public Basis Inverse() public Basis Inverse()
{ {
Basis inv = this; var inv = this;
real_t[] co = new real_t[3] var co = new real_t[3]
{ {
inv[1, 1] * inv[2, 2] - inv[1, 2] * inv[2, 1], inv[1, 1] * inv[2, 2] - inv[1, 2] * inv[2, 1],
inv[1, 2] * inv[2, 0] - inv[1, 0] * inv[2, 2], inv[1, 2] * inv[2, 0] - inv[1, 0] * inv[2, 2],
@ -311,7 +311,7 @@ namespace Godot
public Basis Scaled(Vector3 scale) public Basis Scaled(Vector3 scale)
{ {
Basis m = this; var m = this;
m[0, 0] *= scale.x; m[0, 0] *= scale.x;
m[0, 1] *= scale.x; m[0, 1] *= scale.x;
@ -343,7 +343,7 @@ namespace Godot
public Basis Transposed() public Basis Transposed()
{ {
Basis tr = this; var tr = this;
real_t temp = this[0, 1]; real_t temp = this[0, 1];
this[0, 1] = this[1, 0]; this[0, 1] = this[1, 0];
@ -415,8 +415,8 @@ namespace Godot
(_x[2] - _z[0]) * inv_s (_x[2] - _z[0]) * inv_s
); );
} else { } else {
real_t s = Mathf.Sqrt(-_x[0] - _y[1] + _z[2] + 1.0f) * 2f; var s = Mathf.Sqrt(-_x[0] - _y[1] + _z[2] + 1.0f) * 2f;
real_t inv_s = 1f / s; var inv_s = 1f / s;
return new Quat( return new Quat(
(_x[2] + _z[0]) * inv_s, (_x[2] + _z[0]) * inv_s,
(_y[2] + _z[1]) * inv_s, (_y[2] + _z[1]) * inv_s,
@ -450,7 +450,7 @@ namespace Godot
public Basis(Vector3 axis, real_t phi) public Basis(Vector3 axis, real_t phi)
{ {
Vector3 axis_sq = new Vector3(axis.x * axis.x, axis.y * axis.y, axis.z * axis.z); var axis_sq = new Vector3(axis.x * axis.x, axis.y * axis.y, axis.z * axis.z);
real_t cosine = Mathf.Cos( phi); real_t cosine = Mathf.Cos( phi);
real_t sine = Mathf.Sin( phi); real_t sine = Mathf.Sin( phi);

View File

@ -45,8 +45,8 @@ namespace Godot
{ {
get get
{ {
float max = Mathf.Max(r, Mathf.Max(g, b)); float max = Math.Max(r, Math.Max(g, b));
float min = Mathf.Min(r, Mathf.Min(g, b)); float min = Math.Min(r, Math.Min(g, b));
float delta = max - min; float delta = max - min;
@ -79,8 +79,8 @@ namespace Godot
{ {
get get
{ {
float max = Mathf.Max(r, Mathf.Max(g, b)); float max = Math.Max(r, Math.Max(g, b));
float min = Mathf.Min(r, Mathf.Min(g, b)); float min = Math.Min(r, Math.Min(g, b));
float delta = max - min; float delta = max - min;
@ -96,7 +96,7 @@ namespace Godot
{ {
get get
{ {
return Mathf.Max(r, Mathf.Max(g, b)); return Math.Max(r, Math.Max(g, b));
} }
set set
{ {
@ -265,7 +265,7 @@ namespace Godot
public Color LinearInterpolate(Color b, float t) public Color LinearInterpolate(Color b, float t)
{ {
Color res = this; var res = this;
res.r += (t * (b.r - r)); res.r += (t * (b.r - r));
res.g += (t * (b.g - g)); res.g += (t * (b.g - g));
@ -303,7 +303,7 @@ namespace Godot
public string ToHtml(bool include_alpha = true) public string ToHtml(bool include_alpha = true)
{ {
String txt = string.Empty; var txt = string.Empty;
txt += _to_hex(r); txt += _to_hex(r);
txt += _to_hex(g); txt += _to_hex(g);
@ -339,10 +339,10 @@ namespace Godot
{ {
int ig = 0; int ig = 0;
for (int i = 0; i < 2; i++) for (var i = 0; i < 2; i++)
{ {
int c = str[i + ofs]; int c = str[i + ofs];
int v = 0; var v = 0;
if (c >= '0' && c <= '9') if (c >= '0' && c <= '9')
{ {
@ -374,11 +374,11 @@ namespace Godot
private String _to_hex(float val) private String _to_hex(float val)
{ {
int v = (int) Mathf.Clamp(val * 255.0f, 0, 255); var v = (int) Mathf.Clamp(val * 255.0f, 0, 255);
string ret = string.Empty; var ret = string.Empty;
for (int i = 0; i < 2; i++) for (var i = 0; i < 2; i++)
{ {
char[] c = { (char)0, (char)0 }; char[] c = { (char)0, (char)0 };
int lv = v & 0xF; int lv = v & 0xF;
@ -403,7 +403,7 @@ namespace Godot
if (color[0] == '#') if (color[0] == '#')
color = color.Substring(1, color.Length - 1); color = color.Substring(1, color.Length - 1);
bool alpha = false; var alpha = false;
if (color.Length == 8) if (color.Length == 8)
alpha = true; alpha = true;
@ -449,7 +449,7 @@ namespace Godot
if (rgba[0] == '#') if (rgba[0] == '#')
rgba = rgba.Substring(1); rgba = rgba.Substring(1);
bool alpha = false; var alpha = false;
if (rgba.Length == 8) if (rgba.Length == 8)
{ {

View File

@ -32,7 +32,7 @@ namespace Godot
return; return;
} }
StringBuilder sb = new StringBuilder(); var sb = new StringBuilder();
if (methodBase is MethodInfo) if (methodBase is MethodInfo)
sb.AppendTypeName(((MethodInfo)methodBase).ReturnType); sb.AppendTypeName(((MethodInfo)methodBase).ReturnType);
@ -47,7 +47,7 @@ namespace Godot
sb.Append("<"); sb.Append("<");
for (int j = 0; j < genericParams.Length; j++) for (var j = 0; j < genericParams.Length; j++)
{ {
if (j > 0) if (j > 0)
sb.Append(", "); sb.Append(", ");
@ -64,7 +64,7 @@ namespace Godot
ParameterInfo[] parameter = methodBase.GetParameters(); ParameterInfo[] parameter = methodBase.GetParameters();
for (int i = 0; i < parameter.Length; i++) for (var i = 0; i < parameter.Length; i++)
{ {
if (i > 0) if (i > 0)
sb.Append(", "); sb.Append(", ");

View File

@ -91,9 +91,9 @@ namespace Godot
public static int[] Range(int length) public static int[] Range(int length)
{ {
int[] ret = new int[length]; var ret = new int[length];
for (int i = 0; i < length; i++) for (var i = 0; i < length; i++)
{ {
ret[i] = i; ret[i] = i;
} }
@ -106,9 +106,9 @@ namespace Godot
if (to < from) if (to < from)
return new int[0]; return new int[0];
int[] ret = new int[to - from]; var ret = new int[to - from];
for (int i = from; i < to; i++) for (var i = from; i < to; i++)
{ {
ret[i - from] = i; ret[i - from] = i;
} }
@ -124,19 +124,19 @@ namespace Godot
return new int[0]; return new int[0];
// Calculate count // Calculate count
int count = 0; var count = 0;
if (increment > 0) if (increment > 0)
count = ((to - from - 1) / increment) + 1; count = ((to - from - 1) / increment) + 1;
else else
count = ((from - to - 1) / -increment) + 1; count = ((from - to - 1) / -increment) + 1;
int[] ret = new int[count]; var ret = new int[count];
if (increment > 0) if (increment > 0)
{ {
int idx = 0; int idx = 0;
for (int i = from; i < to; i += increment) for (var i = from; i < to; i += increment)
{ {
ret[idx++] = i; ret[idx++] = i;
} }
@ -144,7 +144,7 @@ namespace Godot
else else
{ {
int idx = 0; int idx = 0;
for (int i = from; i > to; i += increment) for (var i = from; i > to; i += increment)
{ {
ret[idx++] = i; ret[idx++] = i;
} }

View File

@ -7,9 +7,9 @@ namespace Godot
{ {
private static Dictionary<object, object> ArraysToDictionary(object[] keys, object[] values) private static Dictionary<object, object> ArraysToDictionary(object[] keys, object[] values)
{ {
Dictionary<object, object> ret = new Dictionary<object, object>(); var ret = new Dictionary<object, object>();
for (int i = 0; i < keys.Length; i++) for (var i = 0; i < keys.Length; i++)
{ {
ret.Add(keys[i], values[i]); ret.Add(keys[i], values[i]);
} }
@ -19,11 +19,11 @@ namespace Godot
private static void DictionaryToArrays(Dictionary<object, object> from, out object[] keysTo, out object[] valuesTo) private static void DictionaryToArrays(Dictionary<object, object> from, out object[] keysTo, out object[] valuesTo)
{ {
Dictionary<object, object>.KeyCollection keys = from.Keys; var keys = from.Keys;
keysTo = new object[keys.Count]; keysTo = new object[keys.Count];
keys.CopyTo(keysTo, 0); keys.CopyTo(keysTo, 0);
Dictionary<object, object>.ValueCollection values = from.Values; var values = from.Values;
valuesTo = new object[values.Count]; valuesTo = new object[values.Count];
values.CopyTo(valuesTo, 0); values.CopyTo(valuesTo, 0);
} }

View File

@ -116,7 +116,7 @@ namespace Godot
// Calculate cosine // Calculate cosine
real_t cosom = x * b.x + y * b.y + z * b.z + w * b.w; real_t cosom = x * b.x + y * b.y + z * b.z + w * b.w;
real_t[] to1 = new real_t[4]; var to1 = new real_t[4];
// Adjust signs if necessary // Adjust signs if necessary
if (cosom < 0.0) if (cosom < 0.0)

View File

@ -38,7 +38,7 @@ namespace Godot
public Rect2 Clip(Rect2 b) public Rect2 Clip(Rect2 b)
{ {
Rect2 newRect = b; var newRect = b;
if (!Intersects(newRect)) if (!Intersects(newRect))
return new Rect2(); return new Rect2();
@ -64,7 +64,7 @@ namespace Godot
public Rect2 Expand(Vector2 to) public Rect2 Expand(Vector2 to)
{ {
Rect2 expanded = this; var expanded = this;
Vector2 begin = expanded.position; Vector2 begin = expanded.position;
Vector2 end = expanded.position + expanded.size; Vector2 end = expanded.position + expanded.size;
@ -92,7 +92,7 @@ namespace Godot
public Rect2 Grow(real_t by) public Rect2 Grow(real_t by)
{ {
Rect2 g = this; var g = this;
g.position.x -= by; g.position.x -= by;
g.position.y -= by; g.position.y -= by;
@ -104,7 +104,7 @@ namespace Godot
public Rect2 GrowIndividual(real_t left, real_t top, real_t right, real_t bottom) public Rect2 GrowIndividual(real_t left, real_t top, real_t right, real_t bottom)
{ {
Rect2 g = this; var g = this;
g.position.x -= left; g.position.x -= left;
g.position.y -= top; g.position.y -= top;
@ -116,7 +116,7 @@ namespace Godot
public Rect2 GrowMargin(Margin margin, real_t by) public Rect2 GrowMargin(Margin margin, real_t by)
{ {
Rect2 g = this; var g = this;
g.GrowIndividual((Margin.Left == margin) ? by : 0, g.GrowIndividual((Margin.Left == margin) ? by : 0,
(Margin.Top == margin) ? by : 0, (Margin.Top == margin) ? by : 0,

View File

@ -82,9 +82,9 @@ namespace Godot
// </summary> // </summary>
public static string[] Bigrams(this string instance) public static string[] Bigrams(this string instance)
{ {
string[] b = new string[instance.Length - 1]; var b = new string[instance.Length - 1];
for (int i = 0; i < b.Length; i++) for (var i = 0; i < b.Length; i++)
{ {
b[i] = instance.Substring(i, 2); b[i] = instance.Substring(i, 2);
} }
@ -97,7 +97,7 @@ namespace Godot
// </summary> // </summary>
public static string CEscape(this string instance) public static string CEscape(this string instance)
{ {
StringBuilder sb = new StringBuilder(string.Copy(instance)); var sb = new StringBuilder(string.Copy(instance));
sb.Replace("\\", "\\\\"); sb.Replace("\\", "\\\\");
sb.Replace("\a", "\\a"); sb.Replace("\a", "\\a");
@ -119,7 +119,7 @@ namespace Godot
// </summary> // </summary>
public static string CUnescape(this string instance) public static string CUnescape(this string instance)
{ {
StringBuilder sb = new StringBuilder(string.Copy(instance)); var sb = new StringBuilder(string.Copy(instance));
sb.Replace("\\a", "\a"); sb.Replace("\\a", "\a");
sb.Replace("\\b", "\b"); sb.Replace("\\b", "\b");
@ -142,9 +142,9 @@ namespace Godot
public static string Capitalize(this string instance) public static string Capitalize(this string instance)
{ {
string aux = instance.Replace("_", " ").ToLower(); string aux = instance.Replace("_", " ").ToLower();
string cap = string.Empty; var cap = string.Empty;
for (int i = 0; i < aux.GetSliceCount(" "); i++) for (var i = 0; i < aux.GetSliceCount(" "); i++)
{ {
string slice = aux.GetSlicec(' ', i); string slice = aux.GetSlicec(' ', i);
if (slice.Length > 0) if (slice.Length > 0)
@ -259,12 +259,12 @@ namespace Godot
{ {
int basepos = instance.Find("://"); int basepos = instance.Find("://");
string rs = string.Empty; var rs = string.Empty;
string @base = string.Empty; var @base = string.Empty;
if (basepos != -1) if (basepos != -1)
{ {
int end = basepos + 3; var end = basepos + 3;
rs = instance.Substring(end, instance.Length); rs = instance.Substring(end, instance.Length);
@base = instance.Substring(0, end); @base = instance.Substring(0, end);
} }
@ -378,7 +378,7 @@ namespace Godot
while (instance[src] != 0 && text[tgt] != 0) while (instance[src] != 0 && text[tgt] != 0)
{ {
bool match = false; var match = false;
if (case_insensitive) if (case_insensitive)
{ {
@ -446,7 +446,7 @@ namespace Godot
if (len == 0) if (len == 0)
return false; return false;
for (int i = 0; i < len; i++) for (var i = 0; i < len; i++)
{ {
if (i == 0) if (i == 0)
{ {
@ -482,7 +482,7 @@ namespace Godot
if (ip.Length != 4) if (ip.Length != 4)
return false; return false;
for (int i = 0; i < ip.Length; i++) for (var i = 0; i < ip.Length; i++)
{ {
string n = ip[i]; string n = ip[i];
if (!n.IsValidInteger()) if (!n.IsValidInteger())
@ -501,7 +501,7 @@ namespace Godot
// </summary> // </summary>
public static string JsonEscape(this string instance) public static string JsonEscape(this string instance)
{ {
StringBuilder sb = new StringBuilder(string.Copy(instance)); var sb = new StringBuilder(string.Copy(instance));
sb.Replace("\\", "\\\\"); sb.Replace("\\", "\\\\");
sb.Replace("\b", "\\b"); sb.Replace("\b", "\\b");
@ -810,9 +810,9 @@ namespace Godot
float sum = src_size + tgt_size; float sum = src_size + tgt_size;
float inter = 0; float inter = 0;
for (int i = 0; i < src_size; i++) for (var i = 0; i < src_size; i++)
{ {
for (int j = 0; j < tgt_size; j++) for (var j = 0; j < tgt_size; j++)
{ {
if (srcBigrams[i] == tgtBigrams[j]) if (srcBigrams[i] == tgtBigrams[j])
{ {
@ -838,7 +838,7 @@ namespace Godot
// </summary> // </summary>
public static float[] SplitFloats(this string instance, string divisor, bool allow_empty = true) public static float[] SplitFloats(this string instance, string divisor, bool allow_empty = true)
{ {
List<float> ret = new List<float>(); var ret = new List<float>();
int from = 0; int from = 0;
int len = instance.Length; int len = instance.Length;

View File

@ -28,7 +28,7 @@ namespace Godot
public Transform LookingAt(Vector3 target, Vector3 up) public Transform LookingAt(Vector3 target, Vector3 up)
{ {
Transform t = this; var t = this;
t.SetLookAt(origin, target, up); t.SetLookAt(origin, target, up);
return t; return t;
} }

View File

@ -110,7 +110,7 @@ namespace Godot
public Transform2D AffineInverse() public Transform2D AffineInverse()
{ {
Transform2D inv = this; var inv = this;
real_t det = this[0, 0] * this[1, 1] - this[1, 0] * this[0, 1]; real_t det = this[0, 0] * this[1, 1] - this[1, 0] * this[0, 1];
@ -157,15 +157,15 @@ namespace Godot
Vector2 s2 = m.Scale; Vector2 s2 = m.Scale;
// Slerp rotation // Slerp rotation
Vector2 v1 = new Vector2(Mathf.Cos(r1), Mathf.Sin(r1)); var v1 = new Vector2(Mathf.Cos(r1), Mathf.Sin(r1));
Vector2 v2 = new Vector2(Mathf.Cos(r2), Mathf.Sin(r2)); var v2 = new Vector2(Mathf.Cos(r2), Mathf.Sin(r2));
real_t dot = v1.Dot(v2); real_t dot = v1.Dot(v2);
// Clamp dot to [-1, 1] // Clamp dot to [-1, 1]
dot = (dot < -1.0f) ? -1.0f : ((dot > 1.0f) ? 1.0f : dot); dot = (dot < -1.0f) ? -1.0f : ((dot > 1.0f) ? 1.0f : dot);
Vector2 v = new Vector2(); var v = new Vector2();
if (dot > 0.9995f) if (dot > 0.9995f)
{ {
@ -184,7 +184,7 @@ namespace Godot
Vector2 p2 = m.Origin; Vector2 p2 = m.Origin;
// Construct matrix // Construct matrix
Transform2D res = new Transform2D(Mathf.Atan2(v.y, v.x), p1.LinearInterpolate(p2, c)); var res = new Transform2D(Mathf.Atan2(v.y, v.x), p1.LinearInterpolate(p2, c));
Vector2 scale = s1.LinearInterpolate(s2, c); Vector2 scale = s1.LinearInterpolate(s2, c);
res.x *= scale; res.x *= scale;
res.y *= scale; res.y *= scale;
@ -194,7 +194,7 @@ namespace Godot
public Transform2D Inverse() public Transform2D Inverse()
{ {
Transform2D inv = this; var inv = this;
// Swap // Swap
real_t temp = inv.x.y; real_t temp = inv.x.y;
@ -208,7 +208,7 @@ namespace Godot
public Transform2D Orthonormalized() public Transform2D Orthonormalized()
{ {
Transform2D on = this; var on = this;
Vector2 onX = on.x; Vector2 onX = on.x;
Vector2 onY = on.y; Vector2 onY = on.y;
@ -230,7 +230,7 @@ namespace Godot
public Transform2D Scaled(Vector2 scale) public Transform2D Scaled(Vector2 scale)
{ {
Transform2D copy = this; var copy = this;
copy.x *= scale; copy.x *= scale;
copy.y *= scale; copy.y *= scale;
copy.o *= scale; copy.o *= scale;
@ -249,7 +249,7 @@ namespace Godot
public Transform2D Translated(Vector2 offset) public Transform2D Translated(Vector2 offset)
{ {
Transform2D copy = this; var copy = this;
copy.o += copy.BasisXform(offset); copy.o += copy.BasisXform(offset);
return copy; return copy;
} }

View File

@ -99,7 +99,7 @@ namespace Godot
public Vector2 Clamped(real_t length) public Vector2 Clamped(real_t length)
{ {
Vector2 v = this; var v = this;
real_t l = Length(); real_t l = Length();
if (l > 0 && length < l) if (l > 0 && length < l)
@ -113,10 +113,10 @@ namespace Godot
public Vector2 CubicInterpolate(Vector2 b, Vector2 preA, Vector2 postB, real_t t) public Vector2 CubicInterpolate(Vector2 b, Vector2 preA, Vector2 postB, real_t t)
{ {
Vector2 p0 = preA; var p0 = preA;
Vector2 p1 = this; var p1 = this;
Vector2 p2 = b; var p2 = b;
Vector2 p3 = postB; var p3 = postB;
real_t t2 = t * t; real_t t2 = t * t;
real_t t3 = t2 * t; real_t t3 = t2 * t;
@ -164,7 +164,7 @@ namespace Godot
public Vector2 LinearInterpolate(Vector2 b, real_t t) public Vector2 LinearInterpolate(Vector2 b, real_t t)
{ {
Vector2 res = this; var res = this;
res.x += (t * (b.x - x)); res.x += (t * (b.x - x));
res.y += (t * (b.y - y)); res.y += (t * (b.y - y));
@ -174,7 +174,7 @@ namespace Godot
public Vector2 Normalized() public Vector2 Normalized()
{ {
Vector2 result = this; var result = this;
result.Normalize(); result.Normalize();
return result; return result;
} }

View File

@ -111,10 +111,10 @@ namespace Godot
public Vector3 CubicInterpolate(Vector3 b, Vector3 preA, Vector3 postB, real_t t) public Vector3 CubicInterpolate(Vector3 b, Vector3 preA, Vector3 postB, real_t t)
{ {
Vector3 p0 = preA; var p0 = preA;
Vector3 p1 = this; var p1 = this;
Vector3 p2 = b; var p2 = b;
Vector3 p3 = postB; var p3 = postB;
real_t t2 = t * t; real_t t2 = t * t;
real_t t3 = t2 * t; real_t t3 = t2 * t;
@ -196,7 +196,7 @@ namespace Godot
public Vector3 Normalized() public Vector3 Normalized()
{ {
Vector3 v = this; var v = this;
v.Normalize(); v.Normalize();
return v; return v;
} }