module

Rosegold::Vec3(T)

Constructors

new(x : T, y : T, z : T)
Source

Instance methods

&*(other : T) : self
Source
*(other : T) : self
Source
+(other : self) : self
Source
+(other : BlockFace) : Vec3d
Source
-(other : self) : self
Source
/(other : T) : self
Source
==(other : Vec3(T)) : Bool
Source
[](i : Number) : T
Source
almost_eq(other : self, closer_than = 0.01) : Bool
Source
axis(face : BlockFace) : T
Source
block
Source
centered_3d

Useful for getting the center of a block.

Source
centered_floor

Useful for standing centered on a block.

Source
dist(other : self) : T
Source
dist_sq(other : self) : T
Source
down(len : T = 1) : self
Source
east(len : T = 1) : self
Source
floored
Source
inspect(io)
Source
join(sep = ", ")
Source
len_sq
Source
length
Source
map(block : T -> T) : self
Source
minus(dx : T, dy : T, dz : T) : self
Source
normed
Source
north(len : T = 1) : self
Source
plus(dx : T, dy : T, dz : T) : self
Source
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.

Source
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.

Source
rounded
Source
south(len : T = 1) : self
Source
to_f32
Source
to_f64
Source
to_s(io, sep = ", ")
Source
up(len : T = 1) : self
Source
west(len : T = 1) : self
Source
with_axis(face : BlockFace, value : T) : self
Source
with_length(length : Float64) : Vec3d
Source
with_x(x : T) : self
Source
with_y(y : T) : self
Source
with_z(z : T) : self
Source
xz_dist(other : self) : T

Ignores y difference.

Source