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 src/animation/AnimationAction.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class AnimationAction {
* loop state).
*
* @type {number}
* @default Infinity
* @default 0
*/
this.time = 0;

Expand Down
2 changes: 1 addition & 1 deletion src/core/Clock.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class Clock {
* Whether the clock is running or not.
*
* @type {boolean}
* @default true
* @default false
*/
this.running = false;

Expand Down
2 changes: 1 addition & 1 deletion src/extras/core/ShapePath.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class ShapePath {
* The paths that have been generated for this shape.
*
* @type {Array<Path>}
* @default null
* @default []
*/
this.subPaths = [];

Expand Down
2 changes: 1 addition & 1 deletion src/materials/MeshDepthMaterial.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ class MeshDepthMaterial extends Material {
* map set, this value is not applied.
*
* @type {number}
* @default 0
* @default 1
*/
this.displacementScale = 1;

Expand Down
2 changes: 1 addition & 1 deletion src/materials/MeshDistanceMaterial.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class MeshDistanceMaterial extends Material {
* map set, this value is not applied.
*
* @type {number}
* @default 0
* @default 1
*/
this.displacementScale = 1;

Expand Down
2 changes: 1 addition & 1 deletion src/materials/MeshLambertMaterial.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ class MeshLambertMaterial extends Material {
* map set, this value is not applied.
*
* @type {number}
* @default 0
* @default 1
*/
this.displacementScale = 1;

Expand Down
2 changes: 1 addition & 1 deletion src/materials/MeshMatcapMaterial.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ class MeshMatcapMaterial extends Material {
* map set, this value is not applied.
*
* @type {number}
* @default 0
* @default 1
*/
this.displacementScale = 1;

Expand Down
2 changes: 1 addition & 1 deletion src/materials/MeshNormalMaterial.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ class MeshNormalMaterial extends Material {
* map set, this value is not applied.
*
* @type {number}
* @default 0
* @default 1
*/
this.displacementScale = 1;

Expand Down
2 changes: 1 addition & 1 deletion src/materials/MeshPhongMaterial.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ class MeshPhongMaterial extends Material {
* map set, this value is not applied.
*
* @type {number}
* @default 0
* @default 1
*/
this.displacementScale = 1;

Expand Down
2 changes: 1 addition & 1 deletion src/materials/MeshPhysicalMaterial.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class MeshPhysicalMaterial extends MeshStandardMaterial {
* property provides additional rotation to the vectors in the texture.
*
* @type {number}
* @default 1
* @default 0
*/
this.anisotropyRotation = 0;

Expand Down
2 changes: 1 addition & 1 deletion src/materials/MeshStandardMaterial.js
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ class MeshStandardMaterial extends Material {
* map set, this value is not applied.
*
* @type {number}
* @default 0
* @default 1
*/
this.displacementScale = 1;

Expand Down
2 changes: 1 addition & 1 deletion src/materials/MeshToonMaterial.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ class MeshToonMaterial extends Material {
* map set, this value is not applied.
*
* @type {number}
* @default 0
* @default 1
*/
this.displacementScale = 1;

Expand Down
3 changes: 2 additions & 1 deletion src/math/Triangle.js
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,8 @@ class Triangle {
}

const vc = d1 * d4 - d3 * d2;
if ( vc <= 0 && d1 >= 0 && d3 <= 0 ) {

if ( vc <= 0 && d1 >= 0 && d3 <= 0 && d1 - d3 > 0 ) { // modification of the algorithm: d1 - d3 is the squared length of AB, so skip this region if a and b coincide

v = d1 / ( d1 - d3 );
// edge region of AB; barycentric coords (1-v, v, 0)
Expand Down
2 changes: 1 addition & 1 deletion src/nodes/display/PassNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ class PassNode extends Node {
* Whether the pass is transparent.
*
* @type {boolean}
* @default false
* @default true
*/
this.transparent = true;

Expand Down
2 changes: 1 addition & 1 deletion src/nodes/lighting/ShadowNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ class ShadowNode extends ShadowBaseNode {
*
* @type {number}
* @readonly
* @default true
* @default 0
*/
this.depthLayer = 0;

Expand Down
6 changes: 3 additions & 3 deletions src/objects/BatchedMesh.js
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ class BatchedMesh extends Mesh {
/**
* Computes the bounding box, updating {@link BatchedMesh#boundingBox}.
* Bounding boxes aren't computed by default. They need to be explicitly computed,
* otherwise they are `null`.
* otherwise they are `null`. Must be recomputed when instances change.
*/
computeBoundingBox() {

Expand Down Expand Up @@ -527,8 +527,8 @@ class BatchedMesh extends Mesh {

/**
* Computes the bounding sphere, updating {@link BatchedMesh#boundingSphere}.
* Bounding spheres aren't computed by default. They need to be explicitly computed,
* otherwise they are `null`.
* The engine computes the bounding sphere once when it is needed. Must be
* recomputed when instances change.
*/
computeBoundingSphere() {

Expand Down
5 changes: 5 additions & 0 deletions test/unit/src/math/Triangle.tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,11 @@ export default QUnit.module( 'Maths', () => {
a.closestPointToPoint( new Vector3( 0, - 2, 0 ), point );
assert.ok( point.equals( new Vector3( 0, 0, 0 ) ), 'Passed!' );

// degenerate triangle where a and b coincide
a.set( zero3, zero3, new Vector3( 2, 0, 0 ) );
a.closestPointToPoint( new Vector3( 1, 1, 0 ), point );
assert.ok( point.equals( new Vector3( 1, 0, 0 ) ), 'Passed!' );

} );

QUnit.test( 'isFrontFacing', ( assert ) => {
Expand Down
Loading