mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 18:31:55 -04:00
Rope.getPoints returns points correctly spaced for curves whose knot values are outside of the range 0 to 1
This commit is contained in:
parent
5dfa504370
commit
07e9aa1811
@ -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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user