VolumetricFire constructor
VolumetricFire(
- dynamic width,
- dynamic height,
- dynamic depth,
- dynamic sliceSpacing,
- dynamic camera, {
- dynamic color,
Implementation
VolumetricFire(width, height, depth, sliceSpacing, camera, {color}) {
this.camera = camera;
this._sliceSpacing = sliceSpacing;
this._width=width;
this._height=height;
this._depth=depth;
if (color!=null) {
_color=THREE.Vector3(color.r, color.g, color.b);
} else {
_color=THREE.Vector3(1.0,1.0,1.0);
}
var widthHalf = width * 0.5;
var heightHalf = height * 0.5;
var depthHalf = depth * 0.5;
this._posCorners = [
new THREE.Vector3(-widthHalf, -heightHalf, -depthHalf),
new THREE.Vector3(widthHalf, -heightHalf, -depthHalf),
new THREE.Vector3(-widthHalf, heightHalf, -depthHalf),
new THREE.Vector3(widthHalf, heightHalf, -depthHalf),
new THREE.Vector3(-widthHalf, -heightHalf, depthHalf),
new THREE.Vector3(widthHalf, -heightHalf, depthHalf),
new THREE.Vector3(-widthHalf, heightHalf, depthHalf),
new THREE.Vector3(widthHalf, heightHalf, depthHalf)
];
this._texCorners = [
new THREE.Vector3(0, 0, 0),
new THREE.Vector3(1, 0, 0),
new THREE.Vector3(0, 1, 0),
new THREE.Vector3(1, 1, 0),
new THREE.Vector3(0, 0, 1),
new THREE.Vector3(1, 0, 1),
new THREE.Vector3(0, 1, 1),
new THREE.Vector3(1, 1, 1)
];
this._viewVector = new THREE.Vector3();
}