AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   How to get velocity by angles? (https://forums.alliedmods.net/showthread.php?t=183886)

Leech_v2 04-28-2012 06:33

How to get velocity by angles?
 
↖↑↗
← →
↙↓↘

Direction ...
angle_vector can only ←→↑↓

Exolent[jNr] 04-28-2012 15:55

Re: How to get velocity by angles?
 
Code:
AnglesToVelocity(const Float:angles[3], Float:speed, Float:velocity[3]) {     engfunc(EngFunc_MakeVectors, angles);     global_get(glb_v_forward, velocity);         new Float:length = vector_length(velocity);         velocity[0] *= (speed / length);     velocity[1] *= (speed / length);     velocity[2] *= (speed / length); }


All times are GMT -4. The time now is 07:46.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.