LA::AVector4
Inherits Struct < Value < Object
Constants
COMPONENTS = [:x, :y, :z, :w]
Constructors
new(x : Float64, y : Float64, z : Float64, w : Float64)
new(default : Float64 = 0.0)
Class methods
one
w
x
Generate some utility constants like
Vector3::Y => Vector3(0.0, 1.0, 0.0)
y
z
zero
Instance methods
*(other : Float64)
+(other : self)
-(other : self)
-
/(other : Float64)
dot(other : self)
length
normalize
If the vector has just one component precalculating the inverse would not improve the performance TODO: validate if precalculating is faster for 2 components
squared_length
w
w=(w : Float64)
x
x=(x : Float64)
y
y=(y : Float64)
z
z=(z : Float64)