Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6a08b8f9 authored by ztenghui's avatar ztenghui Committed by Android (Google) Code Review
Browse files

Merge "Fix the (0,0) vector case for extra vertices computation" into lmp-dev

parents 75f903e1 26131368
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -93,6 +93,10 @@ inline float getTransformedAlphaFromFactoredZ(float factoredZ) {

inline int getExtraVertexNumber(const Vector2& vector1, const Vector2& vector2,
        float divisor) {
    // When there is no distance difference, there is no need for extra vertices.
    if (vector1.lengthSquared() == 0 || vector2.lengthSquared() == 0) {
        return 0;
    }
    // The formula is :
    // extraNumber = floor(acos(dot(n1, n2)) / (M_PI / EXTRA_VERTEX_PER_PI))
    // The value ranges for each step are: