mirror of
https://github.com/tengge1/ShadowEditor.git
synced 2026-01-25 15:08:11 +00:00
17 lines
438 B
JavaScript
17 lines
438 B
JavaScript
/**
|
|
* 正方体
|
|
* @param {*} geometry 几何体
|
|
* @param {*} material 材质
|
|
*/
|
|
function Box(geometry = new THREE.BoxBufferGeometry(1, 1, 1), material = new THREE.MeshStandardMaterial()) {
|
|
THREE.Mesh.call(this, geometry, material);
|
|
|
|
this.name = '正方体';
|
|
this.castShadow = true;
|
|
this.receiveShadow = true;
|
|
}
|
|
|
|
Box.prototype = Object.create(THREE.Mesh.prototype);
|
|
Box.prototype.constructor = Box;
|
|
|
|
export default Box; |