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
3 changes: 1 addition & 2 deletions src/scene/geometry/box-geometry.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Vec3 } from '../../core/math/vec3.js';
import { calculateTangents } from './geometry-utils.js';
import { Geometry } from './geometry.js';

const primitiveUv1Padding = 8.0 / 64;
Expand Down Expand Up @@ -175,7 +174,7 @@ class BoxGeometry extends Geometry {
this.indices = indices;

if (opts.calculateTangents) {
this.tangents = calculateTangents(positions, normals, uvs, indices);
this.calculateTangents();
}
}
}
Expand Down
3 changes: 1 addition & 2 deletions src/scene/geometry/capsule-geometry.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { ConeBaseGeometry } from './cone-base-geometry.js';
import { calculateTangents } from './geometry-utils.js';

/**
* A procedural capsule-shaped geometry.
Expand Down Expand Up @@ -69,7 +68,7 @@ class CapsuleGeometry extends ConeBaseGeometry {
super(radius, radius, height - 2 * radius, heightSegments, sides, true);

if (opts.calculateTangents) {
this.tangents = calculateTangents(this.positions, this.normals, this.uvs, this.indices);
this.calculateTangents();
}
}
}
Expand Down
3 changes: 1 addition & 2 deletions src/scene/geometry/circle-geometry.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { calculateTangents } from './geometry-utils.js';
import { Geometry } from './geometry.js';

/**
Expand Down Expand Up @@ -119,7 +118,7 @@ class CircleGeometry extends Geometry {
this.indices = indices;

if (opts.calculateTangents) {
this.tangents = calculateTangents(positions, normals, uvs, indices);
this.calculateTangents();
}
}
}
Expand Down
3 changes: 1 addition & 2 deletions src/scene/geometry/cone-geometry.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { ConeBaseGeometry } from './cone-base-geometry.js';
import { calculateTangents } from './geometry-utils.js';

/**
* A procedural cone-shaped geometry.
Expand Down Expand Up @@ -68,7 +67,7 @@ class ConeGeometry extends ConeBaseGeometry {
super(baseRadius, peakRadius, height, heightSegments, capSegments, false);

if (opts.calculateTangents) {
this.tangents = calculateTangents(this.positions, this.normals, this.uvs, this.indices);
this.calculateTangents();
}
}
}
Expand Down
3 changes: 1 addition & 2 deletions src/scene/geometry/cylinder-geometry.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { ConeBaseGeometry } from './cone-base-geometry.js';
import { calculateTangents } from './geometry-utils.js';

/**
* A procedural cylinder-shaped geometry.
Expand Down Expand Up @@ -68,7 +67,7 @@ class CylinderGeometry extends ConeBaseGeometry {
super(radius, radius, height, heightSegments, capSegments, false);

if (opts.calculateTangents) {
this.tangents = calculateTangents(this.positions, this.normals, this.uvs, this.indices);
this.calculateTangents();
}
}
}
Expand Down
3 changes: 1 addition & 2 deletions src/scene/geometry/plane-geometry.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Vec2 } from '../../core/math/vec2.js';
import { calculateTangents } from './geometry-utils.js';
import { Geometry } from './geometry.js';

/**
Expand Down Expand Up @@ -108,7 +107,7 @@ class PlaneGeometry extends Geometry {
this.indices = indices;

if (opts.calculateTangents) {
this.tangents = calculateTangents(positions, normals, uvs, indices);
this.calculateTangents();
}
}
}
Expand Down
3 changes: 1 addition & 2 deletions src/scene/geometry/sphere-geometry.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { calculateTangents } from './geometry-utils.js';
import { Geometry } from './geometry.js';

/**
Expand Down Expand Up @@ -107,7 +106,7 @@ class SphereGeometry extends Geometry {
this.indices = indices;

if (opts.calculateTangents) {
this.tangents = calculateTangents(positions, normals, uvs, indices);
this.calculateTangents();
}
}
}
Expand Down
3 changes: 1 addition & 2 deletions src/scene/geometry/torus-geometry.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { math } from '../../core/math/math.js';
import { calculateTangents } from './geometry-utils.js';
import { Geometry } from './geometry.js';

/**
Expand Down Expand Up @@ -112,7 +111,7 @@ class TorusGeometry extends Geometry {
this.indices = indices;

if (opts.calculateTangents) {
this.tangents = calculateTangents(positions, normals, uvs, indices);
this.calculateTangents();
}
}
}
Expand Down