Tres::Vector
Inherits Reference < Object
Constructors
new(elements : Array(Float32))
SourceInstance methods
[](index)
Source[]=(index, value)
Sourceadd(v)
Sourceadd_scalar(s)
Sourceadd_vectors(a, b)
Sourceangle_to(v)
Sourceceil
Sourceclamp(min, max)
Sourceclamp_scalar(min, max)
Sourcecopy(v)
Sourcedistance_to(v)
Sourcedivide(v)
Sourcedivide_scalar(s)
Sourceeach_dimension
Sourceelements
Sourceelements=(elements : Array(Float32))
Sourcefloor
Sourcefrom_array(array : Array(Float32), offset = 0)
Sourcelength
Sourcelength_sq
Sourcelerp(v, alpha)
Sourcelerp_vectors(v1, v2, alpha)
Sourcemax(v)
Sourcemin(v)
Sourcemultiply(v)
Sourcemultiply_scalar(s)
Sourcemultiply_vectors(a, b)
Sourcenegate
Sourcenormalize
Sourceproject_on_plane(plane_normal)
Sourceproject_on_vector(vector)
Sourcereflect(normal)
Sourceround
Sourceround_to_zero
Sourceset(elements : Array(Float32))
Sourceset_length(l)
Sourcesub(v)
Sourcesub_scalar(s)
Sourcesub_vectors(a, b)
Sourceto_a(array = [0_f32, 0_f32], offset = 0)
Sourceto_array(array = [0_f32, 0_f32], offset = 0)
Sourceto_s
Returns a nicely readable and concise string representation of this object, typically intended for users.
This method should usually not be overridden. It delegates to
#to_s(IO) which can be overridden for custom implementations.
Also see #inspect.