class AncestralComum {
constructor(dados) {
this.dados = dados ? dados : undefined;
if (this.dados && this.dados.criar) this.criar();
}
criarDados() {
return {};
}
criar() {
this.antesCriar();
this.duranteCriar();
this.depoisCriar();
}
antesCriar() {
}
duranteCriar() {
}
depoisCriar() {
}
destruir() {
this.antesDestruir();
this.duranteDestruir();
this.depoisDestruir();
}
antesDestruir() {
}
duranteDestruir() {
}
depoisDestruir() {
}
adicionar(pai,objeto) {
pai.add(objeto);
return objeto;
}
remover(pai,filho) {
if (filho.geometry) {
filho.geometry.dispose();
//filho.material.dispose();
}
pai.remove(filho);
filho = undefined;
}
}