Needle Engine

Changes between version 4.1.0 and 4.1.1
Files changed (2) hide show
  1. src/engine/engine_input.ts +4 -0
  2. src/engine-components/particlesystem/ParticleSystem.ts +2 -1
src/engine/engine_input.ts CHANGED
@@ -450,6 +450,10 @@
450
450
  if (i >= this._pointerPositionsDelta.length) return null;
451
451
  return this._pointerPositionsDelta[i];
452
452
  }
453
+ /**
454
+ * The pointer position in screenspace coordinates (-1 to 1) where 0 is the center of the screen.
455
+ * This can be useful for e.g. raycasting (see https://threejs.org/docs/#api/en/core/Raycaster.setFromCamera)
456
+ */
453
457
  getPointerPositionRC(i: number): Vector2 | null {
454
458
  if (i >= this._pointerPositionsRC.length) return null;
455
459
  return this._pointerPositionsRC[i];
src/engine-components/particlesystem/ParticleSystem.ts CHANGED
@@ -88,7 +88,8 @@
88
88
  material.map.colorSpace = LinearSRGBColorSpace;
89
89
  material.map.premultiplyAlpha = false;
90
90
  }
91
- const newMaterial = new MeshBasicMaterial({ map: material.map });
91
+ const newMaterial = new MeshBasicMaterial();
92
+ newMaterial.copy(material);
92
93
  if (trailEnabled) this.trailMaterial = newMaterial;
93
94
  else this.particleMaterial = newMaterial;
94
95
  }