mirror of
https://github.com/3b1b/manim.git
synced 2025-08-05 16:49:03 +00:00
Small clean up
This commit is contained in:
parent
802bd58aa7
commit
7212a98d65
1 changed files with 2 additions and 4 deletions
|
@ -86,10 +86,8 @@ int get_corners(
|
||||||
vec2 p2 = controls[2];
|
vec2 p2 = controls[2];
|
||||||
|
|
||||||
// Unit vectors for directions between control points
|
// Unit vectors for directions between control points
|
||||||
vec2 v10 = normalize(p0 - p1);
|
vec2 v01 = normalize(p1 - p0);
|
||||||
vec2 v12 = normalize(p2 - p1);
|
vec2 v12 = normalize(p2 - p1);
|
||||||
vec2 v01 = -v10;
|
|
||||||
vec2 v21 = -v12;
|
|
||||||
|
|
||||||
float cross_prod = cross2d(v01, v12);
|
float cross_prod = cross2d(v01, v12);
|
||||||
float sgn = (cross_prod >= 0.0 || bool(is_linear)) ? 1.0 : -1.0;
|
float sgn = (cross_prod >= 0.0 || bool(is_linear)) ? 1.0 : -1.0;
|
||||||
|
@ -109,7 +107,7 @@ int get_corners(
|
||||||
|
|
||||||
// Account for previous and next control points
|
// Account for previous and next control points
|
||||||
create_joint(angle_from_prev, v01, buff0, c0, c0, c1, c1);
|
create_joint(angle_from_prev, v01, buff0, c0, c0, c1, c1);
|
||||||
create_joint(angle_to_next, v21, buff2, c3, c3, c2, c2);
|
create_joint(angle_to_next, -v12, buff2, c3, c3, c2, c2);
|
||||||
|
|
||||||
// Linear case is the simplest
|
// Linear case is the simplest
|
||||||
if(bool(is_linear)){
|
if(bool(is_linear)){
|
||||||
|
|
Loading…
Add table
Reference in a new issue