module Rosegold::Vec3(T)

Direct including types

Defined in:

rosegold/world/vec3.cr

Constructors

Instance Method Summary

Constructor Detail

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

[View source]

Instance Method Detail

def &*(scalar : T) : self #

[View source]
def *(scalar : T) : self #

[View source]
def +(vec : self) : self #

[View source]
def +(face : BlockFace) : Vec3d #

[View source]
def -(vec : self) : self #

[View source]
def - : self #

[View source]
def /(scalar : T) : self #

[View source]
def ==(vec : Vec3(T)) : Bool #

[View source]
def [](i : Number) : T #

[View source]
def almost_eq(other : self, closer_than = 0.01) : Bool #

[View source]
def axis(face : BlockFace) : T #

[View source]
def block : Vec3i #

[View source]
def centered_3d : Vec3d #

Useful for getting the center of a block.


[View source]
def centered_floor : Vec3d #

Useful for standing centered on a block.


[View source]
def dist(other : self) : T #

[View source]
def dist_sq(other : self) : T #

[View source]
def down(len : T = 1) : self #

[View source]
def east(len : T = 1) : self #

[View source]
def floored : Vec3d #

[View source]
def inspect(io) #

[View source]
def join(sep = ", ") #

[View source]
def len_sq : T #

[View source]
def length : Float64 #

[View source]
def map(block : T -> T) : self #

[View source]
def minus(dx : T, dy : T, dz : T) : self #

[View source]
def normed : self #

[View source]
def north(len : T = 1) : self #

[View source]
def plus(dx : T, dy : T, dz : T) : self #

[View source]
def project_onto_line(start : self, direction : self) : self #

The point on the line through start and start+direction that is closest to self. See also #projected_factor_along_line.


[View source]
def projected_factor_along_line(start : self, direction : self) : T #

How far to move from start in direction units to arrive at the point that is closest to self. See also #project_onto_line.


[View source]
def rounded : self #

[View source]
def south(len : T = 1) : self #

[View source]
def to_f32 : Vec3f #

[View source]
def to_f64 : Vec3d #

[View source]
def to_s(io, sep = ", ") #

[View source]
def up(len : T = 1) : self #

[View source]
def west(len : T = 1) : self #

[View source]
def with_axis(face : BlockFace, value : T) : self #

[View source]
def with_length(length : Float64) : Vec3d #

[View source]
def with_x(x : T) : self #

[View source]
def with_y(y : T) : self #

[View source]
def with_z(z : T) : self #

[View source]
def x : T #

[View source]
def xz_dist(other : self) : T #

Ignores y difference.


[View source]
def y : T #

[View source]
def z : T #

[View source]