struct Godot::Quaternion

Overview

4-element structure that represents a 3D rotation with hypercomplex numbers (x, y, z, w).

Defined in:

libgodot/types/quaternion.cr

Constant Summary

IDENTITY = Quaternion.new(0.0_f32, 0.0_f32, 0.0_f32, 1.0_f32)

Constructors

Instance Method Summary

Constructor Detail

def self.from_axis_angle(axis : Vector3, angle : Number) : Quaternion #

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

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

def self.new(axis : Vector3, angle : Number) #

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

Instance Method Detail

def !=(other : Quaternion) : Bool #

def *(scalar : Number) : Quaternion #

def *(other : Quaternion) : Quaternion #

def *(vec : Vector3) : Vector3 #

def +(other : Quaternion) : Quaternion #

def -(other : Quaternion) : Quaternion #

def - : Quaternion #

def /(scalar : Number) : Quaternion #

def ==(other : Quaternion) : Bool #

def dot(other : Quaternion) : Float32 #

def get_angle : Float32 #

def get_axis : Vector3 #

def inverse : Quaternion #

def is_equal_approx(other : Quaternion) : Bool #

def is_finite? : Bool #

def is_normalized? : Bool #

def length : Float32 #

def length_squared : Float32 #

def normalized : Quaternion #

def slerp(to : Quaternion, weight : Number) : Quaternion #

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) #