struct

GS::Utils::Vec3

Inherits Struct < Value < Object

Lightweight 3D vector

Constructors

new(x : Float64, y : Float64, z : Float64)
Source
zero
Source

Instance methods

*(scalar : Float64) : Vec3
Source
+(other : Vec3) : Vec3
Source
-(other : Vec3) : Vec3
Source
/(scalar : Float64) : Vec3
Source
cross(other : Vec3) : Vec3
Source
distance_to(other : Vec3) : Float64
Source
dot(other : Vec3) : Float64
Source
dup

Returns a shallow copy of this object.

Because Value is a value type, this method returns self, which already involves a shallow copy of this object because value types are passed by value.

Source
length
Source
magnitude
Source
magnitude_squared
Source
normalize
Source
to_a
Source