XRain.js 789 B

1234567891011121314151617181920212223
  1. import XSubSequence from "./XSubSequence.js"
  2. export default class XRain extends XSubSequence {
  3. constructor(e, t, r) {
  4. super(e, t, r);
  5. this.onLoadedObserverable.addOnce(()=>{
  6. this._particleGroups.forEach(n=>{
  7. const o = n.systems[0];
  8. o.getClassName() == "ParticleSystem" && (o.startPositionFunction = function(a, s) {
  9. const u = 2 * Math.random() * Math.PI
  10. , c = Math.random() * 15 * Math.sin(u)
  11. , h = this.minEmitBox.y
  12. , f = Math.random() * 15 * Math.cos(u);
  13. BABYLON.Vector3.TransformCoordinatesFromFloatsToRef(c, h, f, a, s)
  14. }
  15. )
  16. }
  17. )
  18. }
  19. )
  20. }
  21. }