Перейти к содержанию

Vector3::multiply

Материал из RAGE MP Wiki Archive
Версия от 06:13, 31 мая 2019; imported>Micaww (Created page with "This function is used to multiply a Vector3 by another Vector3 or scalar. ==Syntax== <pre> vector.add(Vector3 otherVec); vector.add(number scalar); </pre> ===Required Argume...")
(разн.) ← Предыдущая версия | Текущая версия (разн.) | Следующая версия → (разн.)

This function is used to multiply a Vector3 by another Vector3 or scalar.

Syntax

vector.add(Vector3 otherVec);
vector.add(number scalar);

Required Arguments

  • otherVec: Vector3 or number: The vector or scalar to be added to the callee.

Returns

  • Vector3 The product.

Example #1

Server-Side
const vec1 = new mp.Vector3(100, 100, 100);
const vec2 = new mp.Vector3(2, 3, 4);

const product = vec1.multiply(vec2); // total = {x: 200, y: 300, z: 400}

Example #2

Server-Side
const vec1 = new mp.Vector3(20, 40, 60);
const scalar = 2;

const product = vec1.multiply(scalar); // total = {x: 40, y: 80, z: 120}

See Also