struct Godot::Vector3i

Overview

3-element structure that can be used to represent 3D grid coordinates or discrete voxels with 32-bit integers.

Defined in:

libgodot/types/vector3.cr

Constant Summary

BACK = Vector3i.new(0, 0, 1)
DOWN = Vector3i.new(0, -1, 0)
FORWARD = Vector3i.new(0, 0, -1)
LEFT = Vector3i.new(-1, 0, 0)
ONE = Vector3i.new(1, 1, 1)
RIGHT = Vector3i.new(1, 0, 0)
UP = Vector3i.new(0, 1, 0)
ZERO = Vector3i.new(0, 0, 0)

Constructors

Instance Method Summary

Constructor Detail

def self.new(x : Int32 = 0, y : Int32 = 0, z : Int32 = 0) #

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

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

Instance Method Detail

def !=(other : Vector3i) : Bool #

def *(scalar : Number) : Vector3i #

def *(other : Vector3i) : Vector3i #

def +(other : Vector3i) : Vector3i #

def -(other : Vector3i) : Vector3i #

def - : Vector3i #

def /(scalar : Number) : Vector3i #

def /(other : Vector3i) : Vector3i #

def ==(other : Vector3i) : Bool #

def abs : Vector3i #

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

def distance_manhattan_to(other : Vector3i) : Int32 #

Manhattan (taxicab) distance to other integer position.


def max(other : Vector3i) : Vector3i #

def min(other : Vector3i) : Vector3i #

def sign : Vector3i #

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

Same as #inspect(io).


def to_v3 : Vector3 #

def x : Int32 #

def x=(x : Int32) #

def y : Int32 #

def y=(y : Int32) #

def z : Int32 #

def z=(z : Int32) #