vec3.addPolar: Difference between revisions

From GTA Connected
Jump to navigation Jump to search
m (Mex moved page Vec3.addPolar to vec3.addPolar)
 
No edit summary
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
{{ScriptItem
{{ScriptItem2
|endpoint = shared
|name = addPolar
|side = shared
|type = method
|type = method
|class = Vec3
|class = Vec3
|name = addPolar
|games = iii vc sa iv
|parameters = float radius, float angle
|desc = fetch a new 3D vector with a 2D offset added to the vector, calculated with the polar co-ordinate system. The new vector's z co-ordinate is copied
|parameter1 = float radius The radius of the circle.
|arg1 = float radius The radius of the circle.
|parameter2 = float angle The angle of the line.
|arg2 = float angle The angle of the line.
|returnTypes = Vec3
|return = Vec3 the new 3D vector
|returnInfo = the new 3D vector
|freturn = Vec3 Vec3(0.0,0.0,0.0)
|usage = fetch a new 3D vector with a 2D offset added to the vector, calculated with the polar co-ordinate system. The new vector's z co-ordinate is copied
|exampleJSSS = let position = client.player.position.addPolar(15.0, client.player.heading + (Math.PI/2.0));
|returnFail1 = Vec3 Vec3(0.0,0.0,0.0)
|exampleJSCS = let position = localClient.player.position.addPolar(15.0, localClient.player.heading + (Math.PI/2.0));
}}
}}

Latest revision as of 19:00, 15 June 2026

Method Server and Client GTAIII Logo.png icon-vc.png icon-sa.png icon-iv.png Online and Offline

Available since Server 1.0.0, Client 1.0.0
Vec3 vec3.addPolar(float radius, float angle)
The vec3.addPolar method is used to fetch a new 3D vector with a 2D offset added to the vector, calculated with the polar co-ordinate system. The new vector's z co-ordinate is copied.

Parameters

1) float radius The radius of the circle.
2) float angle The angle of the line.

Return

Vec3 The new 3D vector.

Types

Shared Vec3

Notes

There aren't any notes for this method.

Examples

Example 1 - JavaScript - Server-Side:

let position = client.player.position.addPolar(15.0, client.player.heading + (Math.PI/2.0));


Example 2 - JavaScript - Client-Side:

let position = localClient.player.position.addPolar(15.0, localClient.player.heading + (Math.PI/2.0));

Compatibility

There isn't any compatibility information for this method.