This commit is contained in:
syuilo 2019-08-19 15:59:36 +09:00
parent 3b445af6fc
commit 01e692b353

View File

@ -441,7 +441,7 @@ export class Room {
}
@autobind
public applyCustomColor(model: THREE.Object3D) {
private applyCustomColor(model: THREE.Object3D) {
const furniture = this.furnitures.find(furniture => furniture.id === model.name);
const def = furnitureDefs.find(d => d.id === furniture.type);
if (def.color == null) return;
@ -465,7 +465,7 @@ export class Room {
}
@autobind
public applyCustomTexture(model: THREE.Object3D) {
private applyCustomTexture(model: THREE.Object3D) {
const furniture = this.furnitures.find(furniture => furniture.id === model.name);
const def = furnitureDefs.find(d => d.id === furniture.type);
if (def.texture == null) return;
@ -619,6 +619,10 @@ export class Room {
});
}
/**
* /
* @param type
*/
@autobind
public enterTransformMode(type: 'translate' | 'rotate') {
this.isTransformMode = true;
@ -626,12 +630,20 @@ export class Room {
this.furnitureControl.attach(this.selectedObject);
}
/**
* /
*/
@autobind
public exitTransformMode() {
this.isTransformMode = false;
this.furnitureControl.detach();
}
/**
*
* @param key
* @param value
*/
@autobind
public updateProp(key: string, value: any) {
const furniture = this.furnitures.find(furniture => furniture.id === this.selectedObject.name);
@ -641,6 +653,10 @@ export class Room {
this.applyCustomTexture(this.selectedObject);
}
/**
*
* @param type
*/
@autobind
public addFurniture(type: string) {
const furniture = {
@ -666,6 +682,9 @@ export class Room {
});
}
/**
*
*/
@autobind
public removeFurniture() {
this.exitTransformMode();
@ -677,12 +696,20 @@ export class Room {
this.onChangeSelect(null);
}
/**
*
* @param color
*/
@autobind
public updateCarpetColor(color: string) {
this.roomInfo.carpetColor = color;
this.applyCarpetColor();
}
/**
*
* @param type
*/
@autobind
public changeRoomType(type: string) {
this.roomInfo.roomType = type;
@ -690,6 +717,9 @@ export class Room {
this.loadRoom();
}
/**
*
*/
@autobind
public getRoomInfo() {
for (const obj of this.objects) {
@ -705,6 +735,9 @@ export class Room {
return this.roomInfo;
}
/**
*
*/
@autobind
public getSelectedObject() {
return this.selectedObject;
@ -715,6 +748,9 @@ export class Room {
return this.furnitures.find(furniture => furniture.id === id);
}
/**
*
*/
@autobind
public destroy() {
// Stop render loop