提交 03119e5d 编写于 作者: M Mugen87

CatmullRomCurve3: Enhance constructor and copy()

上级 ce239513
......@@ -41,11 +41,12 @@ var curveObject = new THREE.Line( geometry, material );
<h2>Constructor</h2>
<h3>[name]( [page:Array points], [page:Boolean closed], [page:Float tension] )</h3>
<h3>[name]( [page:Array points], [page:Boolean closed], [page:String curveType], [page:Float tension] )</h3>
<div>
points – An array of [page:Vector3] points<br/>
closed – Whether the curve is closed. Default is *false*.
tension – Tension of the curve. Default is *false*.
closed – Whether the curve is closed. Default is *false*.<br/>
curveType – Type of the curve. Default is *centripetal*.<br/>
tension – Tension of the curve. Default is *0.5*.
</div>
......@@ -66,10 +67,10 @@ var curveObject = new THREE.Line( geometry, material );
<div>The curve will loop back onto itself when this is true.</div>
<h3>[property:String curveType]</h3>
<div>Possible values are `centripetal` (default), `chordal` and `catmullrom`.</div>
<div>Possible values are *centripetal*, *chordal* and *catmullrom*.</div>
<h3>[property:float tension]</h3>
<div>When [page:.type] is `catmullrom`, defines catmullrom's tension. Defaults is *0.5*.</div>
<div>When [page:.type] is *catmullrom*, defines catmullrom's tension.</div>
<h2>Methods</h2>
......
......@@ -83,7 +83,7 @@ function CubicPoly() {
var tmp = new Vector3();
var px = new CubicPoly(), py = new CubicPoly(), pz = new CubicPoly();
function CatmullRomCurve3( points, closed, tension ) {
function CatmullRomCurve3( points, closed, curveType, tension ) {
Curve.call( this );
......@@ -91,8 +91,8 @@ function CatmullRomCurve3( points, closed, tension ) {
this.points = points || [];
this.closed = closed || false;
this.curveType = curveType || 'centripetal';
this.tension = tension || 0.5;
this.curveType = 'centripetal';
}
......@@ -200,6 +200,7 @@ CatmullRomCurve3.prototype.copy = function ( source ) {
}
this.closed = source.closed;
this.curveType = source.curveType;
this.tension = source.tension;
return this;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册