module Rosegold::Vec3(T)
Direct including types
Defined in:
rosegold/world/vec3.crConstructors
Instance Method Summary
- #&*(scalar : T) : self
- #*(scalar : T) : self
- #+(vec : self) : self
- #+(face : BlockFace) : Vec3d
- #-(vec : self) : self
- #- : self
- #/(scalar : T) : self
- #==(vec : Vec3(T)) : Bool
- #[](i : Number) : T
- #almost_eq(other : self, closer_than = 0.01) : Bool
- #axis(face : BlockFace) : T
- #block : Vec3i
-
#centered_3d : Vec3d
Useful for getting the center of a block.
-
#centered_floor : Vec3d
Useful for standing centered on a block.
- #dist(other : self) : T
- #dist_sq(other : self) : T
- #down(len : T = 1) : self
- #east(len : T = 1) : self
- #floored : Vec3d
- #inspect(io)
- #join(sep = ", ")
- #len_sq : T
- #length : Float64
- #map(block : T -> T) : self
- #minus(dx : T, dy : T, dz : T) : self
- #normed : self
- #north(len : T = 1) : self
- #plus(dx : T, dy : T, dz : T) : self
-
#project_onto_line(start : self, direction : self) : self
The point on the line through
start
andstart+direction
that is closest toself
. -
#projected_factor_along_line(start : self, direction : self) : T
How far to move from
start
indirection
units to arrive at the point that is closest toself
. - #rounded : self
- #south(len : T = 1) : self
- #to_f32 : Vec3f
- #to_f64 : Vec3d
- #to_s(io, sep = ", ")
- #up(len : T = 1) : self
- #west(len : T = 1) : self
- #with_axis(face : BlockFace, value : T) : self
- #with_length(length : Float64) : Vec3d
- #with_x(x : T) : self
- #with_y(y : T) : self
- #with_z(z : T) : self
- #x : T
-
#xz_dist(other : self) : T
Ignores y difference.
- #y : T
- #z : T
Constructor Detail
Instance Method Detail
The point on the line through start
and start+direction
that is closest to self
.
See also #projected_factor_along_line
.
How far to move from start
in direction
units to arrive at the point that is closest to self
.
See also #project_onto_line
.