BezierCurve little issue

From the docs:


  • <code>getPoint</code> calculates a point on a Bezier curve from a given
  • time value within the interval [0, 1]. If the value is zero or less, the
  • first control point is returned. If the value is one or more, the last
  • control point is returned. Using the equation of a Bezier Curve, the
  • point at the interval is calculated and returned.



    From the code:


if (time > 1) {
          BufferUtils.populateFromBuffer(point, getVertexBuffer(), getVertexCount() - 1);
         return point;
      }



should be fixed as


if (time >= 1) {
          BufferUtils.populateFromBuffer(point, getVertexBuffer(), getVertexCount() - 1);
         return point;
      }




The CatmullRomCurve is OK.

One committer to fix this, please.

Cheers,

Mik

the patch:


Index: src/com/jme/curve/BezierCurve.java
===================================================================
--- src/com/jme/curve/BezierCurve.java   (revision 4766)
+++ src/com/jme/curve/BezierCurve.java   (working copy)
@@ -102,7 +102,7 @@
          return point;
       }
       //last point.
-      if (time > 1) {
+      if (time >= 1) {
           BufferUtils.populateFromBuffer(point, getVertexBuffer(), getVertexCount() - 1);
          return point;
       }

committed

many thanks :slight_smile: