Skip to content

format

typescript
Vector4.Set(index, value)

class: Vector4

description

Set the value of the component at the specified index in the current Vector4 object.

parameter

param_nametypedescription
indexnumberThe specified index position, which can be a value between [0, 3].
valuenumberThe value to set for the component.

reture

typedescription
void

code example

typescript
let v4 = new Vector4(-1, -2, -3, -4);
v4.Set(0, 1);
v4.Set(1, 2);
v4.Set(2, 3);
v4.Set(3, 4);