Browse Source

Rope.getPoints returns points correctly spaced for curves whose knot values are outside of the range 0 to 1

Ken Patel 15 years ago
parent
commit
07e9aa1811
1 changed files with 4 additions and 1 deletions
  1. 4 1
      direct/src/showutil/Rope.py

+ 4 - 1
direct/src/showutil/Rope.py

@@ -131,10 +131,13 @@ class Rope(NodePath):
         Rope itself."""
         Rope itself."""
         
         
         result = self.curve.evaluate(self)
         result = self.curve.evaluate(self)
+        startT = result.getStartT()
+        sizeT = result.getEndT() - startT
+
         numPts = len
         numPts = len
         ropePts = []
         ropePts = []
         for i in range(numPts):
         for i in range(numPts):
             pt = Point3()
             pt = Point3()
-            result.evalPoint(i / float(numPts - 1), pt)
+            result.evalPoint(sizeT * i / float(numPts - 1) + startT, pt)
             ropePts.append(pt)
             ropePts.append(pt)
         return ropePts
         return ropePts