HollowBond/Public/ecma/Geometries/Debug/ElevatorGeometryDebug.ecma.js

33 lines
809 B
JavaScript

"use strict";
const ElevatorGeometryDebug = (function(){
const ElevatorGeometryDebug = function(hollow_bond){
let instance = null;
/**
* Devuelve la geometría única compartida para las cabinas de ascensor.
*/
this.get = () => {
if(!instance){
const size = hollow_bond.elevator_size || 2,
floor_height = hollow_bond.room_height || 3,
height = floor_height * 0.9;
instance = new THREE.BoxGeometry(size, height, size);
}
return instance;
};
this.reset = () => {
if(instance){
instance.dispose();
instance = null;
}
};
};
return ElevatorGeometryDebug;
})();