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

This commit is contained in:
Ken Patel 2010-04-29 18:06:00 +00:00
parent 5dfa504370
commit 07e9aa1811

View File

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