Vector3::divide: Difference between revisions

From RAGE Multiplayer Wiki
(Created page with "This function is used to divide a Vector3 by another Vector3. ==Syntax== <pre> vector.divide(Vector3 otherVec); </pre> ===Required Arguments=== *'''otherVec:''' Vector3: The...")
 
No edit summary
Line 7: Line 7:
===Required Arguments===
===Required Arguments===
*'''otherVec:''' Vector3: The vector to divide the callee by.
*'''otherVec:''' Vector3: The vector to divide the callee by.
== Returns ==
* {{RageType|Vector3}} The quotient vector.


==Example==  
==Example==  

Revision as of 06:06, 31 May 2019

This function is used to divide a Vector3 by another Vector3.

Syntax

vector.divide(Vector3 otherVec);

Required Arguments

  • otherVec: Vector3: The vector to divide the callee by.

Returns

  • Vector3 The quotient vector.

Example

Server-Side
const vec1 = new mp.Vector3(50, 10, 30);
const vec2 = new mp.Vector3(10, 20, 15);

const quotient = vec1.divide(vec2); // quotient = {x: 5, y: 2, z: 2}

See Also