在终章会放出静态文件,目前只是放出代码
import {Poly} from ‘./Poly’
exportclassOutLine{
constructor(y, z) {
this.index = z;
this.linesPointArray = [];
/* 该代码块正在检查是否存在先前创建的“OutLine”类的实例。如果存在,它会处理该实例的“lineSystem”属性。然后,它检查当前索引(“z”)是否与先前创建的实例的索引相同。如果它们相同,它将先前创建的实例设置为“null”并返回。如果它们不相同,它还会将先前创建的实例设置为“null”。这可确保一次只有一个“OutLine”实例处于活动状态,并在创建新实例时处理前一个实例。 /
if (OutLine.LastCreated) {
OutLine.LastCreated.lineSystem.dispose();
if (z == OutLine.LastCreated.index) {
OutLine.LastCreated = null;
return
};
OutLine.LastCreated = null
};
/ 该代码块正在检查索引“z”处“RawInstances”对象的“multiPolygon”属性是否等于 0。如果是,则进一步检查“CountriesAreVisible”是否为 true。 */
if (Poly.RawInstances[z].multiPolygon == 0) {
if (Poly.CountriesAreVisible) {
this.linesPointArray.push(Poly.CountriesPointsOffset[z]);
BabylonJS + Vue 构建 风场场景 (八) - 小专栏