mirror of
https://github.com/tengge1/ShadowEditor.git
synced 2026-01-25 15:08:11 +00:00
42 lines
857 B
JavaScript
42 lines
857 B
JavaScript
/**
|
|
* 火焰
|
|
*/
|
|
function Fire(camera, options = {}) {
|
|
THREE.Object3D.call(this);
|
|
|
|
VolumetricFire.texturePath = 'assets/textures/VolumetricFire/';
|
|
|
|
var width = options.width || 2;
|
|
var height = options.height || 4;
|
|
var depth = options.depth || 2;
|
|
var sliceSpacing = options.sliceSpacing || 0.5;
|
|
|
|
var fire = new VolumetricFire(
|
|
width,
|
|
height,
|
|
depth,
|
|
sliceSpacing,
|
|
camera
|
|
);
|
|
|
|
this.add(fire.mesh);
|
|
|
|
fire.mesh.name = L_FIRE;
|
|
|
|
this.name = L_FIRE;
|
|
this.position.y = 2;
|
|
|
|
Object.assign(this.userData, {
|
|
type: 'Fire',
|
|
fire: fire,
|
|
width: width,
|
|
height: height,
|
|
depth: depth,
|
|
sliceSpacing: sliceSpacing
|
|
});
|
|
}
|
|
|
|
Fire.prototype = Object.create(THREE.Object3D.prototype);
|
|
Fire.prototype.constructor = Fire;
|
|
|
|
export default Fire; |