提交 99ed4264 编写于 作者: B Ben Houston

bug fixes. all examples now run while using Box3, Sphere and Plane.

上级 53ef1756
......@@ -6,11 +6,13 @@ THREE.Box3 = function ( min, max ) {
// TODO: Is this valid JavaScript to check if the parameters are specified?
if( ! min && ! max ) {
this.min = new THREE.Vector3();
this.max = new THREE.Vector3();
this.makeEmpty();
}
else {
this.min = min || new THREE.Vector3();
this.max = max || this.min; // This is done on purpose so you can make a box using a single point and then expand it.
this.max = max || new THREE.Vector3().copy( this.min ); // This is done on purpose so you can make a box using a single point and then expand it.
}
};
......@@ -35,7 +37,7 @@ THREE.Box3.prototype = {
}
return this;
};
},
setFromCenterAndSize: function ( center, size ) {
......
......@@ -70,7 +70,7 @@ THREE.Plane.prototype = {
// Note: will lead to a divide by zero if the plane is invalid.
var inverseNormalLength = 1.0 / this.normal.length();
this.normal.multipleByScalar( inverseNormalLength );
this.normal.multiplyScalar( inverseNormalLength );
this.constant *= inverseNormalLength;
return this;
......@@ -97,7 +97,7 @@ THREE.Plane.prototype = {
var perpendicularMagnitude = this.distanceToPoint( point );
return new THREE.Vector3().copy( this.normal ).multipleByScalar( perpendicularMagnitude );
return new THREE.Vector3().copy( this.normal ).multiplyScalar( perpendicularMagnitude );
},
intersectsLine: function ( startPoint, endPoint ) {
......
[
"../src/Three.js",
"../src/core/Box3.js",
"../src/core/Clock.js",
"../src/core/Color.js",
"../src/core/Vector2.js",
"../src/core/Vector3.js",
"../src/core/Vector4.js",
"../src/core/Box3.js",
"../src/core/Matrix3.js",
"../src/core/Matrix4.js",
"../src/core/EventTarget.js",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册