LA::AVector3
Inherits Struct < Value < Object
Constants
COMPONENTS = [:x, :y, :z]
Constructors
new(x : Float64, y : Float64, z : Float64)
new(default : Float64 = 0.0)
Class methods
one
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)
cross(other : self)
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
x
x=(x : Float64)
y
y=(y : Float64)
z
z=(z : Float64)