Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/api/en/math/Plane.html
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ <h3>[method:Vector3 intersectLine]( [param:Line3 line], [param:Vector3 target] )
[page:Line3 line] - the [page:Line3] to check for intersection.<br />
[page:Vector3 target] — the result will be copied into this Vector3.<br /><br />

Returns the intersection point of the passed line and the plane. Returns undefined
Returns the intersection point of the passed line and the plane. Returns null
if the line does not intersect. Returns the line's starting point if the line is
coplanar with the plane.
</p>
Expand Down
2 changes: 1 addition & 1 deletion docs/api/zh/math/Plane.html
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ <h3>[method:Vector3 intersectLine]( [param:Line3 line], [param:Vector3 target] )
[page:Line3 line] - 检测是否相交的三维几何线段 [page:Line3]。<br />
[page:Vector3 target] — 结果将会写入该向量中。<br /><br />

返回给定线段和平面的交点。如果不相交则返回undefined。如果线与平面共面,则返回该线段的起始点。
返回给定线段和平面的交点。如果不相交则返回null。如果线与平面共面,则返回该线段的起始点。
</p>

<h3>[method:Boolean intersectsBox]( [param:Box3 box] )</h3>
Expand Down
2 changes: 1 addition & 1 deletion examples/js/misc/ConvexObjectBreaker.js
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ THREE.ConvexObjectBreaker.prototype = {
var intersection = new THREE.Vector3();
intersection = localPlane.intersectLine( this.tempLine1, intersection );

if ( intersection === undefined ) {
if ( intersection === null ) {

// Shouldn't happen
console.error( 'Internal error: segment does not intersect plane.' );
Expand Down
2 changes: 1 addition & 1 deletion examples/jsm/misc/ConvexObjectBreaker.js
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ ConvexObjectBreaker.prototype = {
var intersection = new Vector3();
intersection = localPlane.intersectLine( this.tempLine1, intersection );

if ( intersection === undefined ) {
if ( intersection === null ) {

// Shouldn't happen
console.error( 'Internal error: segment does not intersect plane.' );
Expand Down
4 changes: 2 additions & 2 deletions src/math/Plane.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,15 +133,15 @@ class Plane {
}

// Unsure if this is the correct method to handle this case.
return undefined;
return null;

}

const t = - ( line.start.dot( this.normal ) + this.constant ) / denominator;

if ( t < 0 || t > 1 ) {

return undefined;
return null;

}

Expand Down