Math::Vec3 - mfichman/jogo GitHub Wiki

3-dimensional floating point vector or point. Provides common vector operations, e.g., dot product, cross product, length.

@init(xs Float, ys Float, zs Float)

Initializes a new vector with the given components.

dist(vec Math::Vec3) Float

Returns the distance from this vector to another vector.

dist2(vec Math::Vec3) Float

Returns the square of the distance from this vector to another vector.

cross(vec Math::Vec3) Math::Vec3

Returns the cross product of this vector with another vector. The value returned is self x other.

dot(vec Math::Vec3) Float

Returns the dot product of this vector with another vector.

scale(scale Float) Math::Vec3

Returns a scaled version of this vector; mulitplies each component of this vector with the given scale factor.

len?() Float

Returns the length of this vector, or the distance from the zero vector (0, 0, 0).

len2?() Float

Returns the square of the length of this vector.

str?() String

Returns a string represenation of this vector.

@add(vec Math::Vec3) Math::Vec3

Returns a new vector that is the sum of this vector and another vector.

@sub(vec Math::Vec3) Math::Vec3

Subtracts a vector from this vector and returns the result as a new vector.

@copy(val Math::Vec3)

No comment

@destroy()

No comment

x=(_arg0 Float)

No comment

x?() Float

No comment

y=(_arg0 Float)

No comment

y?() Float

No comment

z=(_arg0 Float)

No comment

z?() Float

No comment