struct Godot::Vector4

Overview

4-element structure that can be used to represent 4D coordinates or homogeneous vectors with 32-bit floating point precision.

Defined in:

libgodot/types/vector4.cr

Constant Summary

INF = Vector4.new(Float32::INFINITY, Float32::INFINITY, Float32::INFINITY, Float32::INFINITY)
ONE = Vector4.new(1.0_f32, 1.0_f32, 1.0_f32, 1.0_f32)
ZERO = Vector4.new(0.0_f32, 0.0_f32, 0.0_f32, 0.0_f32)

Constructors

Instance Method Summary

Constructor Detail

def self.new(x : Float32 = 0.0_f32, y : Float32 = 0.0_f32, z : Float32 = 0.0_f32, w : Float32 = 0.0_f32) #

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

def self.new(pointer : Pointer(Void)) #

Instance Method Detail

def !=(other : Vector4) : Bool #

def *(scalar : Number) : Vector4 #

def *(other : Vector4) : Vector4 #

def +(other : Vector4) : Vector4 #

def -(other : Vector4) : Vector4 #

def - : Vector4 #

def /(scalar : Number) : Vector4 #

def /(other : Vector4) : Vector4 #

def ==(other : Vector4) : Bool #

def abs : Vector4 #

def ceil : Vector4 #

def clamp(min : Vector4, max : Vector4) : Vector4 #

def direction_to(other : Vector4) : Vector4 #

def distance_squared_to(other : Vector4) : Float32 #

def distance_to(other : Vector4) : Float32 #

def dot(other : Vector4) : Float32 #

def floor : Vector4 #

def is_equal_approx(other : Vector4) : Bool #

def is_finite? : Bool #

def is_normalized? : Bool #

def is_zero_approx : Bool #

def is_zero_approx? : Bool #

def length : Float32 #

def length_squared : Float32 #

def lerp(to : Vector4, weight : Number) : Vector4 #

def max(other : Vector4) : Vector4 #

def min(other : Vector4) : Vector4 #

def normalized : Vector4 #

def round : Vector4 #

def sign : Vector4 #

def to_i : Vector4i #

def to_s(io : IO) : Void #
Description copied from struct Struct

Same as #inspect(io).


def w : Float32 #

def w=(w : Float32) #

def x : Float32 #

def x=(x : Float32) #

def y : Float32 #

def y=(y : Float32) #

def z : Float32 #

def z=(z : Float32) #