Răsfoiți Sursa

CurvePath: `.getPoint()` honors `optionalTarget` (#22533)

* CurvePath: `.getPoint()` honors `optionalTarget`

* Update CurvePath.html

* Update CurvePath.html
ycw 3 ani în urmă
părinte
comite
9029dab5f7

+ 0 - 7
docs/api/en/extras/core/CurvePath.html

@@ -44,13 +44,6 @@
 		<h3>[method:Array getCurveLengths]()</h3>
 		<p>Get list of cumulative curve lengths of the curves in the [page:.curves] array.</p>
 
-		<h3>[method:Vector getPoint]( [param:Float t] )</h3>
-		<p>
-			[page:Float t] - A position on the curve. Must be in the range [ 0, 1 ]. <br><br />
-
-			Returns a vector for a given position on the curve path.
-		</p>
-
 		<h3>[method:Array getPoints]( [param:Integer divisions] )</h3>
 		<p>
 			divisions -- number of pieces to divide the curve into. Default is *12*.<br /><br />

+ 0 - 7
docs/api/zh/extras/core/CurvePath.html

@@ -51,13 +51,6 @@
 		<h3>[method:Array getCurveLengths]()</h3>
 		<p>Get list of cumulative curve lengths of the curves in the [page:.curves] array.</p>
 
-		<h3>[method:Vector getPoint]( [param:Float t] )</h3>
-		<p>
-			[page:Float t] - A position on the curve. Must be in the range [ 0, 1 ]. <br><br />
-
-			Returns a vector for a given position on the curve path.
-		</p>
-
 		<h3>[method:Array getPoints]( [param:Integer divisions] )</h3>
 		<p>
 			divisions -- 曲线分段数量。默认值为*12*。<br /><br />

+ 2 - 2
src/extras/core/CurvePath.js

@@ -48,7 +48,7 @@ class CurvePath extends Curve {
 	// 3. Get t for the curve
 	// 4. Return curve.getPointAt(t')
 
-	getPoint( t ) {
+	getPoint( t, optionalTarget ) {
 
 		const d = t * this.getLength();
 		const curveLengths = this.getCurveLengths();
@@ -66,7 +66,7 @@ class CurvePath extends Curve {
 				const segmentLength = curve.getLength();
 				const u = segmentLength === 0 ? 0 : 1 - diff / segmentLength;
 
-				return curve.getPointAt( u );
+				return curve.getPointAt( u, optionalTarget );
 
 			}