it tried to translate java code (link was in post that you gived me link) You can look here PHP: public function drawParticles(Location $location){ $space = 0.20; $defX = $location->getX() - ($space * shape[0] . l$ength / 2) + $space; $x = $defX; $y = $location->getY() + 2.8; $fire = -(($location->getYaw() + 180) / 60); $fire += ($location->Yaw() < -180 ? 3.25 : 2.985); for ($i = 0; $i < $shape . $length; $i++) { for ($j = 0; $j < $shape[i] . $length; $j++) { if ($shape[$i][$j]) { $Locationtarget = $location->getPosition(); $Locationtarget->setMotion($y); $Locationtarget->setMotion($y); $Vectorv = $Locationtarget . $toVector() . subtract * ($location . $toVector()); $Vectorv2 = $getBackVector($location); $v = $rotateAroundAxisY($v, $fire); $v->setMotion(0)->multiply(-0.5); $location->add(v); $location->add(v2); for ($k = 0; $k < 3; $k++){ //create particle } } public static function VectorrotateAroundAxisY(Vector3 $v, $fire){ $cos = $Math->cos($fire); $sin = $Math->sin($fire); $x = $v->getX() * cos + $v->getZ() * $sin; $z = $v->getX() * -sin + $v->getZ() * $cos; return $v->setX($x)->setZ($z); } xd
Good point, I hadn't noticed that. Besides, maybe this thread will be a little more calm. Now, I know extremely little about this complicated math, but I do know a bit about PHP syntax. Variables should(Although I don't think it is necessary) probably start with a lowercase letter, like $variable. $Math appears undefined to me, along with $toVector and $getBackVector. Wouldn't $v->setMotion(0)->multiply(-0.5); keep the motion at 0, since anything multiplied by 0 is still 0? l$ength is probably just a typo, but that also seems undefined. I am probably missing a few things, so feel free to correct me.
Variable names can be any combination of upper and lower case letters (citation needed), it's all up to your personal preference. I'm sure everyone would prefer people use the common variable naming convention, camelCase, when they post code on the forums but there are no rules/guidelines that say it is mandatory.
I've seen a few guides that strongly suggest using the common method, but I haven't ever seen a case where doing differently causes issues. Thanks for clearing it up.
Well, this may be advertising, but i am working on a particles plugin which is able to draw wings and properly align them, but at the moment it is a mess and i have limited time to work on it. It will be released, but i just can't find time to finish it.