UNPKG

@polygonjs/polygonjs

Version:

node-based WebGL 3D engine https://polygonjs.com

17 lines (16 loc) 704 B
"use strict"; import { Vector2 } from "three"; import { ThreeMeshBVHHelper } from "../../geometry/bvh/ThreeMeshBVHHelper"; import { unpackAdjacency3, POPULATE_ADJACENCY_DEFAULT } from "../../geometry/operation/Adjacency"; import { textureSizeFromPointsCount } from "../../geometry/operation/TextureFromAttribute"; export class ClothGeometryInitController { constructor(mesh) { this.mesh = mesh; this.adjacency = []; this.resolution = new Vector2(); this.geometry = mesh.geometry; ThreeMeshBVHHelper.assignDefaultBVHIfNone(this.mesh); this.adjacency = unpackAdjacency3(this.mesh, POPULATE_ADJACENCY_DEFAULT); textureSizeFromPointsCount(this.geometry, this.resolution); } }