Closed duderinone closed 8 years ago
Hi, I'm glad you like BHx :) You're right about all you said, __smartArrayFlags wasn't initialized and this._effect was null. I've fixed this in now with 27b96a3c73d32dd7132f022abbae4985af04a921 and updated all 4 particles samples in 5cd9ec8. Thank you for your help :+1:
I was trying to run Particle2.hx using the cutting edge master branch. (running on windows7, lime, html5 target)
It does not seem to work because of the change in the signature of the function passed into registerBeforeRender. So i patched it in my sand box "function (s:Scene, ?es:EventState)".
Still did not work, its failing here:
Scene.hx:1893
What seems to be happening here is _activeParticleSystems is of type SmartArray, but when we "push" SmartArray::push our particleSystem into _activeParticleSystems, it fails in SmartArray::push
https://github.com/vujadin/BabylonHx/blob/master/com/babylonhx/tools/SmartArray.hx#L33 So perhaps this line should really say: thissmartArrayFlags[this._id] = this._duplicateId; Perhaps we just initialize smartArrayFlags in the constructor of ParticleSystem ?
So i changed that in my sandbox and still not working :-( Its failing here https://github.com/vujadin/BabylonHx/blob/master/com/babylonhx/particles/ParticleSystem.hx#L385
_effect never gets defined when you setup a customEffect. So what i did is change https://github.com/vujadin/BabylonHx/blob/master/com/babylonhx/particles/ParticleSystem.hx#L194 to this._effect = this._getEffect();
The particles2 demo then worked and its pretty nice.
I am actually a C++ programmer - and have never done haxe (yes hax noob!). So i dont know if the master branch has these bugs or if i am just doing something fundamentally wrong ?
I tried the android targets and they are simply stunning. Amazing performance and the fact that it just worked on several android devices is something that i never expected ! This port of babylonjs to haxe by vujadin is simply fantastic!!.