VolumetricFire constructor

VolumetricFire(
  1. dynamic width,
  2. dynamic height,
  3. dynamic depth,
  4. dynamic sliceSpacing,
  5. dynamic camera, {
  6. 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();

}