@Aspect: I've only simplified it a little and modifed some functions according to this movie about improving perfomance (got rid of some math functions). As for collision ray I'm using two rays to detect six collisions xD (I mean one ray activates sparks according to place where it have been hit).