大家好,又见面了,我是你们的朋友全栈君。如果您正在找激活码,请点击查看最新教程,关注关注公众号 “全栈程序员社区” 获取激活教程,可能之前旧版本教程已经失效.最新Idea2022.1教程亲测有效,一键激活。
Jetbrains全家桶1年46,售后保障稳定
/**
*
*创建机柜门 接上一篇
*/
let rearGeometryDoor = new THREE.BoxGeometry(basicParameters.thickness, this.cabinetObj.h,this.cabinetObj.w+basicParameters.thickness*2);
let materialsbgDoor = [];
for (let i = 0; i < rearGeometryDoor.faces.length / 2; i += 1) {
let material
if(i===1){
material = this.cabinetbgMaterial.doorBan[0];
}else if(i===0){
material = this.cabinetbgMaterial.doorBan[1];
}else{
material = this.cabinetbgMaterial.doorBan[2];
}
materialsbgDoor[i] = material
}
// rearGeometryDoor.translate(this.cabinetObj.w/2,0,0)
let door = new THREE.Mesh(rearGeometryDoor,materialsbgDoor);
let doorZ = this.position.z<0?this.position.z – this.cabinetObj.w/2 – this.cabinetObj.z/2: this.position.z + this.cabinetObj.w/2 + this.cabinetObj.z/2
let doorOption = {x:riserR.position.x-basicParameters.thickness/2,y:this.position.y,z:doorZ}
door.name=’door’;
door.closeTag= this.options.closeTag;
if(door.closeTag === ‘open’){
door.position.set(doorOption.x+basicParameters.thickness/2,doorOption.y,doorOption.z)
}else{
door.rotateY(-1.57)
door.position.set(doorOption.x – this.options.cabinetObj.w/2,doorOption.y,doorOption.z – this.options.cabinetObj.w/2+basicParameters.thickness/2)
}
cabGroup.add(door);
// 整个机柜的位置及旋转
cabGroup.name = ‘cabGroup’;
cabGroup.cabId = this.cabId;
cabGroup.position.set(this.cabPosition.x,this.cabPosition.y,this.cabPosition.z)
cabGroup.rotateX(this.cabPosition.rotatex)
cabGroup.rotateY(this.cabPosition.rotatey)
cabGroup.rotateZ(this.cabPosition.rotatez)
for (let i = 0; i < cabGroup.children.length; i++) {
cabGroup.children[i].cabId = this.cabId;
cabGroup.children[i].cabName = ‘cab’;
cabGroup.children[i].cabSlot = this.cabSlot;
cabGroup.children[i].status = this.status;
}
this.scene.add(cabGroup)
}
}
export default cabinet;
发布者:全栈程序员-用户IM,转载请注明出处:https://javaforall.cn/209931.html原文链接:https://javaforall.cn
【正版授权,激活自己账号】: Jetbrains全家桶Ide使用,1年售后保障,每天仅需1毛
【官方授权 正版激活】: 官方授权 正版激活 支持Jetbrains家族下所有IDE 使用个人JB账号...