After @necips has created this cool stuff here Programmer's corner - #59 by Necips I had an idea and @necips kindly agreed to lend me his fella for obviously evil purposes! Thanks dude! You should visit his Programmers corner for some cool math stuff though!
So I took the animation matrices calculation code and started to build some particle collision stuff around it and this has exactly happened to me
This demo is not using the PCS, it’s all custom, so it is not perfect at all. It uses my lovely thin instanced boxes The GUI is Quasar/Vue so it is a quite good example how good the relation between Vue and BabylonJS is and they play very well along each other.
There is a Game mode and a Free shooting mode.
In Game mode you have 20 seconds to shoot. Instructions are on the welcome page, but basically you have to get to a zoom level when the crosshair gets a lock and while the weapon is charging you need to follow the target with the crosshair to not to loose the lock. You can shoot from above as well. After the shooting you will get a visualization of your shots.
The Free shooting mode allows you to control the time of the particles. You can for example Pause the time, shoot at multiple targets and Play and the particles will explode all at once. After shooting the dude you can set the time delta value to -0.1 and observing the process from any angle. Cool things can be done.
Can you go above 11.000 destroyed targets?
Source code available and hopefully those like me still at the beginning of the learning curve will grab something usefull from it (with the mistakes I made as well LOL)
And again thanks goes to the BJS team to giving us this cool framework!
EDIT: Any animated mesh can be used, it is not limited to the Dude, however some values needs to be tweaked.
What’s you score?!
I’m always curious how stuff I code run on other computers so if you are interested how I see this demo running, here is a short YouTube video: