Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- script 454 (int scaleI, int scaleF, int speedF)
- {
- int scale, x, y, z, mag;
- x = GetActorVelX(0); y = GetActorVelY(0); z = GetActorVelZ(0);
- if (speedF == 0) { scale = itof(scaleI) + (scaleF * 0.01); }
- else
- {
- mag = magnitudeThree_f(x, y, z);
- if (mag == 0)
- {
- x = random(-10.0, 10.0);
- y = random(-10.0, 10.0);
- z = random(-10.0, 10.0);
- mag = magnitudeThree_f(x, y, z);
- }
- scale = FixedDiv(speedF * 1.0, mag);
- }
- SetActorVelocity(0, FixedMul(x, scale), FixedMul(y, scale), FixedMul(z, scale), 0, 0);
- // PrintBold(s:"(", f:x, s:", ", f:y, s:", ", f:z, s:"): ", f:scale, s:" -> (", f:GetActorVelX(0), s:", ", f:GetActorVelY(0), s:", ", f:GetActorVelZ(0), s:")");
- // printf("(%f, %f, %f): %f -> (%f, %f, %f)\n", x, y, z, scale, GetActorVelX(0), GetActorVelY(0), GetActorVelZ(0));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement