abstract struct LA::AVector4

Direct Known Subclasses

Defined in:

linalg/vector.cr

Constant Summary

COMPONENTS = [:x, :y, :z, :w]

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(x : Float64, y : Float64, z : Float64, w : Float64) #

[View source]
def self.new(default : Float64 = 0.0) #

[View source]

Class Method Detail

def self.one #

def self.w #

def self.x #

Generate some utility constants like Vector3::Y => Vector3(0.0, 1.0, 0.0)


def self.y #

def self.z #

def self.zero #

Instance Method Detail

def *(other : Float64) #

def +(other : self) #

def -(other : self) #

def - #

def /(other : Float64) #

def dot(other : self) #

def length #

def 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


def squared_length #

def w : Float64 #

def w=(w : Float64) #

def x : Float64 #

def x=(x : Float64) #

def y : Float64 #

def y=(y : Float64) #

def z : Float64 #

def z=(z : Float64) #