struct Godot::Basis

Overview

A 3x3 matrix used for 3D rotation and scale with 32-bit floating point precision.

Defined in:

libgodot/types/basis.cr

Constant Summary

FLIP_X = Basis.new(Vector3.new(-1.0_f32, 0.0_f32, 0.0_f32), Vector3.new(0.0_f32, 1.0_f32, 0.0_f32), Vector3.new(0.0_f32, 0.0_f32, 1.0_f32))
FLIP_Y = Basis.new(Vector3.new(1.0_f32, 0.0_f32, 0.0_f32), Vector3.new(0.0_f32, -1.0_f32, 0.0_f32), Vector3.new(0.0_f32, 0.0_f32, 1.0_f32))
FLIP_Z = Basis.new(Vector3.new(1.0_f32, 0.0_f32, 0.0_f32), Vector3.new(0.0_f32, 1.0_f32, 0.0_f32), Vector3.new(0.0_f32, 0.0_f32, -1.0_f32))
IDENTITY = Basis.new

Constructors

Instance Method Summary

Constructor Detail

def self.from_axis_angle(p_axis : Vector3, p_angle : Number) : Basis #

def self.from_euler(euler : Vector3) : Basis #

def self.looking_at(target : Vector3, up : Vector3 = Vector3::UP) : Basis #

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

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

Instance Method Detail

def !=(other : Basis) : Bool #

def *(vec : Vector3) : Vector3 #

def *(other : Basis) : Basis #

def ==(other : Basis) : Bool #

def determinant : Float32 #

def get_euler : Vector3 #

def get_scale : Vector3 #

def inverse : Basis #

def is_equal_approx(other : Basis) : Bool #

def orthonormalized : Basis #

def rotated(axis : Vector3, angle : Number) : Basis #

def scaled(scale : Vector3) : Basis #

def tdotx(v : Vector3) : Float32 #

def tdoty(v : Vector3) : Float32 #

def tdotz(v : Vector3) : Float32 #

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

Same as #inspect(io).


def transposed : Basis #

def x : Vector3 #

def x=(x : Vector3) #

def y : Vector3 #

def y=(y : Vector3) #

def z : Vector3 #

def z=(z : Vector3) #