đvector
Last updated
Last updated
vec_object:angles(pitch: number, yaw: number):
vector
Name | Type | Description |
---|---|---|
Converts the angle into a forward vector overwriting the vector's coordinates. Returns itself.
vec_object:ceil():
vector
Ceils & overwrites the x, y, and z coordinates of a vector. Returns itself.
vec_object:clone():
vector
Creates and returns a copy of the vector.
vec_object:closest_ray_point(ray_start: vector, ray_end: vector):
vector
Returns the vector of the closest point along a ray.
vec_object:cross(other: vector):
vector
Returns the cross product of two given vectors.
vec_object:dist(other: vector):
number
Returns the Euclidean distance between the two given vectors.
vec_object:dist2d(other: vector):
number
Returns the 2D distance to another vector.
vec_object:dist2dsqr(other: vector):
number
Returns the squared 2D distance to another vector.
vec_object:distsqr(other: vector):
number
Returns the squared Euclidean distance to another vector.
vec_object:dist_to_ray(ray_start: vector, ray_direction: vector):
number
Returns the distance to a ray.
vec_object:dot(other: vector):
number
Returns the dot product of the two given vectors.
vec_object:floor():
vector
Rounds the x, y, and z coordinates of the vector down to the largest integer that is less than or equal. Returns itself.
vec_object:in_range(other: vector, range: number):
boolean
Returns true if the vector is within the given distance to another vector.
vec_object:init(x: number, y: number, z: number):
vector
Overwrites the vector's coordinates. Returns itself.
vec_object:length():
number
Returns the Euclidean length of the vector.
vec_object:length2d():
number
Returns the length of the vector in two dimensions, without the Z axis.
vec_object:length2dsqr():
number
Returns the squared length of the vectors x and y value.
vec_object:lengthsqr():
number
Returns the squared length of the vector.
vec_object:lerp(other: vector, weight: number):
vector
Returns the linearly interpolated vector between two vectors by the specified weight.
vec_object:normalize():
number
Normalizes the vector and returns the length of the vector.
vec_object:normalized():
vector
Returns a vector with the same direction as the specified vector, but with a length of one.
vec_object:scale(scalar: number):
vector
Multiplies the vector by the specified scalar.
vec_object:scaled(scalar: number):
vector
Returns a copy of the vector multiplied by the specified scalar.
vec_object:to(other: vector):
vector
Returns the forward vector from itself to another vector.
vec_object:to_screen():
vector
Returns a vector containing the coordinates where the specified position vector appears on the screen.
vec_object:unpack():
number
, number
, number
Returns the x, y, and z coordinates of the vector. Note that these fields can be accessed by indexing x, y, and z.
vec_object:vectors():
vector
, vector
Returns the right and up vector of a forward vector.
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
ray_start
vector
Ray start position
ray_end
vector
Ray end position
other
vector
The vector to calculate the cross product with
other
vector
The vector to get the distance to
other
vector
The vector to get the distance to
other
vector
The vector to get the squared distance to
other
vector
The vector to get the squared distance to
ray_start
vector
Ray start position
ray_direction
vector
Ray direction
other
vector
The vector to calculate the dot product with
other
vector
The vector to calculate the distance to
range
number
The distance
x
number
New X coordinate
y
number
New Y coordinate
z
number
New Z coordinate
other
vector
The vector to interpolate to
weight
number
A value between 0 and 1 that indicates the weight of other
scalar
number
The scalar value
scalar
number
The scalar value.
other
vector
The vector to get the direction to.
pitch
number
Pitch component of the angle
yaw
number
Yaw component of the angle
angle
vector
Angle vector component