Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Vector3 rot_to_direction(Vector3* rot)//scripthookdotnet source
- {
- float radiansZ = rot->z * 0.0174532924f;
- float radiansX = rot->x * 0.0174532924f;
- float num = std::abs((float)std::cos((double)radiansX));
- Vector3 dir;
- dir.x = (float)((double)((float)(-(float)std::sin((double)radiansZ))) * (double)num);
- dir.y = (float)((double)((float)std::cos((double)radiansZ)) * (double) num);
- dir.z = (float)std::sin((double)radiansX);
- return dir;
- }
- Vector3 multiply(Vector3* vector, float x)
- {
- Vector3 result;
- result.x = vector->x;
- result.y = vector->y;
- result.z = vector->z;
- result.x *= x;
- result.y *= x;
- result.z *= x;
- return result;
- }
- Vector3 add(Vector3* vectorA, Vector3* vectorB)
- {
- Vector3 result;
- result.x = vectorA->x;
- result.y = vectorA->y;
- result.z = vectorA->z;
- result.x += vectorB->x;
- result.y += vectorB->y;
- result.z += vectorB->z;
- return result;
- }
Advertisement
Add Comment
Please, Sign In to add comment