diff options
Diffstat (limited to 'scene/resources/curve.cpp')
-rw-r--r-- | scene/resources/curve.cpp | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/scene/resources/curve.cpp b/scene/resources/curve.cpp index 9188d890f7..ece8ad4bb0 100644 --- a/scene/resources/curve.cpp +++ b/scene/resources/curve.cpp @@ -5,8 +5,8 @@ /* GODOT ENGINE */ /* https://godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2018 Juan Linietsky, Ariel Manzur. */ -/* Copyright (c) 2014-2018 Godot Engine contributors (cf. AUTHORS.md) */ +/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -268,7 +268,7 @@ void Curve::update_auto_tangents(int i) { } if (i + 1 < _points.size()) { - if (p.right_mode == TANGENT_LINEAR && i + 1 < _points.size()) { + if (p.right_mode == TANGENT_LINEAR) { Vector2 v = (_points[i + 1].pos - p.pos).normalized(); p.right_tangent = v.y / v.x; } @@ -761,8 +761,8 @@ Vector2 Curve2D::interpolate_baked(float p_offset, bool p_cubic) const { //validate// int pc = baked_point_cache.size(); if (pc == 0) { - ERR_EXPLAIN("No points in Curve2D"); - ERR_FAIL_COND_V(pc == 0, Vector2()); + ERR_EXPLAIN("No points in Curve2D."); + ERR_FAIL_V(Vector2()); } if (pc == 1) @@ -826,8 +826,8 @@ Vector2 Curve2D::get_closest_point(const Vector2 &p_to_point) const { //validate// int pc = baked_point_cache.size(); if (pc == 0) { - ERR_EXPLAIN("No points in Curve2D"); - ERR_FAIL_COND_V(pc == 0, Vector2()); + ERR_EXPLAIN("No points in Curve2D."); + ERR_FAIL_V(Vector2()); } if (pc == 1) @@ -865,8 +865,8 @@ float Curve2D::get_closest_offset(const Vector2 &p_to_point) const { //validate// int pc = baked_point_cache.size(); if (pc == 0) { - ERR_EXPLAIN("No points in Curve2D"); - ERR_FAIL_COND_V(pc == 0, 0.0f); + ERR_EXPLAIN("No points in Curve2D."); + ERR_FAIL_V(0.0f); } if (pc == 1) @@ -1331,8 +1331,8 @@ Vector3 Curve3D::interpolate_baked(float p_offset, bool p_cubic) const { //validate// int pc = baked_point_cache.size(); if (pc == 0) { - ERR_EXPLAIN("No points in Curve3D"); - ERR_FAIL_COND_V(pc == 0, Vector3()); + ERR_EXPLAIN("No points in Curve3D."); + ERR_FAIL_V(Vector3()); } if (pc == 1) @@ -1375,8 +1375,8 @@ float Curve3D::interpolate_baked_tilt(float p_offset) const { //validate// int pc = baked_tilt_cache.size(); if (pc == 0) { - ERR_EXPLAIN("No tilts in Curve3D"); - ERR_FAIL_COND_V(pc == 0, 0); + ERR_EXPLAIN("No tilts in Curve3D."); + ERR_FAIL_V(0); } if (pc == 1) @@ -1413,8 +1413,8 @@ Vector3 Curve3D::interpolate_baked_up_vector(float p_offset, bool p_apply_tilt) // curve may not have baked up vectors int count = baked_up_vector_cache.size(); if (count == 0) { - ERR_EXPLAIN("No up vectors in Curve3D"); - ERR_FAIL_COND_V(count == 0, Vector3(0, 1, 0)); + ERR_EXPLAIN("No up vectors in Curve3D."); + ERR_FAIL_V(Vector3(0, 1, 0)); } if (count == 1) @@ -1484,8 +1484,8 @@ Vector3 Curve3D::get_closest_point(const Vector3 &p_to_point) const { //validate// int pc = baked_point_cache.size(); if (pc == 0) { - ERR_EXPLAIN("No points in Curve3D"); - ERR_FAIL_COND_V(pc == 0, Vector3()); + ERR_EXPLAIN("No points in Curve3D."); + ERR_FAIL_V(Vector3()); } if (pc == 1) @@ -1523,8 +1523,8 @@ float Curve3D::get_closest_offset(const Vector3 &p_to_point) const { //validate// int pc = baked_point_cache.size(); if (pc == 0) { - ERR_EXPLAIN("No points in Curve3D"); - ERR_FAIL_COND_V(pc == 0, 0.0f); + ERR_EXPLAIN("No points in Curve3D."); + ERR_FAIL_V(0.0f); } if (pc == 1) |