(Go Back) Choose State To Move From
') {
return;
}
// if there is a selected object, reset the material
if (this.selectedObj) {
this.selectedObj.material = this.defaultMaterial;
}
// update the selected object
this.selectedObj = intersects[0].object;
if (this.selectedObj) {
this.selectedObj.material = this.selectedMaterial;
}
}
/**
* Returns the current selected object
*/
getSelectedObject() {
return this.selectedObj;
}
/**
* Sets the current selected object
* @param {THREE.Object3D} obj
*/
setSelectedObject(obj) {
if (this.selectedObj) {
this.selectedObj.material = this.defaultMaterial;
}
this.selectedObj = obj;
if (this.selectedObj) {
this.selectedObj.material = this.selectedMaterial;
}
}
}
module.exports = Selection;