struct
Godot::Vector4
- Godot::Vector4
- Struct
- Value
- Object
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.crConstant 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
- .new(x : Float32 = 0.0_f32, y : Float32 = 0.0_f32, z : Float32 = 0.0_f32, w : Float32 = 0.0_f32)
- .new(x : Number, y : Number, z : Number, w : Number)
- .new(pointer : Pointer(Void))
Instance Method Summary
- #!=(other : Vector4) : Bool
- #*(scalar : Number) : Vector4
- #*(other : Vector4) : Vector4
- #+(other : Vector4) : Vector4
- #-(other : Vector4) : Vector4
- #- : Vector4
- #/(scalar : Number) : Vector4
- #/(other : Vector4) : Vector4
- #==(other : Vector4) : Bool
- #abs : Vector4
- #ceil : Vector4
- #clamp(min : Vector4, max : Vector4) : Vector4
- #direction_to(other : Vector4) : Vector4
- #distance_squared_to(other : Vector4) : Float32
- #distance_to(other : Vector4) : Float32
- #dot(other : Vector4) : Float32
- #floor : Vector4
- #is_equal_approx(other : Vector4) : Bool
- #is_finite? : Bool
- #is_normalized? : Bool
- #is_zero_approx : Bool
- #is_zero_approx? : Bool
- #length : Float32
- #length_squared : Float32
- #lerp(to : Vector4, weight : Number) : Vector4
- #max(other : Vector4) : Vector4
- #min(other : Vector4) : Vector4
- #normalized : Vector4
- #round : Vector4
- #sign : Vector4
- #to_i : Vector4i
-
#to_s(io : IO) : Void
Same as
#inspect(io). - #w : Float32
- #w=(w : Float32)
- #x : Float32
- #x=(x : Float32)
- #y : Float32
- #y=(y : Float32)
- #z : Float32
- #z=(z : Float32)
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)
#