playcanvas
Version:
Open-source WebGL/WebGPU 3D engine for the web
13 lines (10 loc) • 332 B
JavaScript
import { calculateNormals, calculateTangents } from './geometry-utils.js';
class Geometry {
calculateNormals() {
this.normals = calculateNormals(this.positions, this.indices);
}
calculateTangents() {
this.tangents = calculateTangents(this.positions, this.normals, this.uvs, this.indices);
}
}
export { Geometry };