class CenarioAtomico extends Cenario {
antesCriar() {
super.antesCriar();
this.materialS = undefined;
this.materialP = undefined;
this.materialD = undefined;
this.materialF = undefined;
this.materialEletronS = undefined;
this.materialEletronP = undefined;
this.materialEletronD = undefined;
this.materialEletronF = undefined;
this.materialUltimoEletron = undefined;
this.geometriaEletron = undefined;
this.geometriaNucleo = undefined;
this.materialProton = undefined;
this.materialNeutron = undefined;
this.materialEsferaRaio = undefined;
this.geometriaEsferaRaio = undefined;
}
depoisCriar() {
super.depoisCriar();
this.materiais = [this.materialS,this.materialP,this.materialD,this.materialF];
this.materiaisEletron = [this.materialEletronS,this.materialEletronP,this.materialEletronD,this.materialEletronF];
}
antesDestruir() {
super.antesCriar();
if (this.materialS) {this.materialS.dispose(); this.materialS = undefined};
if (this.materialP) {this.materialP.dispose(); this.materialP = undefined};
if (this.materialD) {this.materialD.dispose(); this.materialD = undefined};
if (this.materialF) {this.materialF.dispose(); this.materialF = undefined};
if (this.materialEletronS) {this.materialEletronS.dispose(); this.materialEletronS = undefined};
if (this.materialEletronP) {this.materialEletronP.dispose(); this.materialEletronP = undefined};
if (this.materialEletronD) {this.materialEletronD.dispose(); this.materialEletronD = undefined};
if (this.materialEletronF) {this.materialEletronF.dispose(); this.materialEletronF = undefined};
if (this.materialUltimoEletron) {this.materialUltimoEletron.dispose(); this.materialUltimoEletron = undefined};
if (this.geometriaEletron) {this.geometriaEletron.dispose(); this.geometriaEletron = undefined};
if (this.geometriaNucleo) {this.geometriaNucleo.dispose(); this.geometriaNucleo = undefined};
if (this.materialProton) {this.materialProton.dispose(); this.materialProton = undefined};
if (this.materialNeutron) {this.materialNeutron.dispose(); this.materialNeutron = undefined};
if (this.materialEsferaRaio) {this.materialEsferaRaio.dispose(); this.materialEsferaRaio = undefined};
if (this.geometriaEsferaRaio) {this.geometriaEsferaRaio.dispose(); this.geometriaEsferaRaio = undefined};
}
criarEsferaRaio(raio) {
super.criarEsferaRaio(raio);
this.esferaRaio = THREE.Mesh(this.geometriaEsferaRaio,this.materialEsferaRaio);
return this.esferaRaio;
}
}