vec3_t
Fields#
| Field | Description |
|---|---|
xfloat |
|
yfloat |
|
zfloat |
Operators#
local x = vec3_t(60, 100, 0)
local y = vec3_t(50, 50, 0)
print(x) -- prints formatted
print(x[2]) -- prints y
x[2] = 40 -- sets y to 40
print(x == y) -- prints if x is equal to y
print(x + y) -- prints result of addition
print(x - y) -- prints result of subtraction
print(x / y) -- prints result of division
print(x * y) -- prints result of multiplication
print(-x) -- prints result of inversed x
print(#x) -- prints length of x
Functions#
normalize#
noramlizes the current vector
normalized#
returns a normalized avector and leaves the current vector untouched
length#
returns the length of vector
length2d#
returns the 2d length of vector
cross#
returns the cross product between two vectors
dot#
returns the dot product between two vectors
inverse#
returns the inverse of the vector
dist#
returns the distance between two vectors
scale#
scales the current vector
scaled#
returns a scaled vector but leaves the current vector untouched
to_angle#
converts the vector to an angle
as_angle#
returns the current vector as an angle but doesnt convert it
calc_angle_to#
returns the angle to another vector
is_zero#
returns if the vector is zero
zero#
sets all coords to zero
unpack#
returns all individual coords