class Prism::Maths::Vector3f

Direct Known Subclasses

Defined in:

prism/maths/vector3f.cr

Constructors

Instance Method Summary

Constructor Detail

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

[View source]
def self.new(vector : Vector3f) #

[View source]

Instance Method Detail

def *(r : Vector3f) : Vector3f #

Multiplies two vectors


[View source]
def *(r : Float32) : Vector3f #

Multiplies the vector with a scalar


[View source]
def +(r : Vector3f) : Vector3f #

Adds two vectors


[View source]
def +(r : Float32) : Vector3f #

Adds a scalar value to the vector


[View source]
def -(r : Vector3f) : Vector3f #

Subtracts two vectors


[View source]
def -(r : Float32) : Vector3f #

Subtracts a scalar value from the vector


[View source]
def /(r : Vector3f) : Vector3f #

Divides two vectors


[View source]
def /(r : Float32) : Vector3f #

Divides the vector by a scalar


[View source]
def ==(r : Vector3f) : Bool #

[View source]
def abs : Vector3f #

[View source]
def clone #

Returns a copy of the vector


[View source]
def cross(other : Vector3f) : Vector3f #

Returns the cross product of the vectors


[View source]
def dot(r : Vector3f) : Float32 #

Returns the dot product of the vectors


[View source]
def length : Float32 #

Returns the length the vector (pythagorean theorem)


[View source]
def lerp(dest : Vector3f, lerp_factor : Float32) : Vector3f #

Linear interpolation


[View source]
def max #

Returns the maximum component size


[View source]
def normalize! #

Normalizes this vector


[View source]
def reflect(q : Quaternion) #

[View source]
def rotate(axis : Vector3f, angle : Float32) : Vector3f #

Rotates the vector by some angle


[View source]
def rotate(rotation : Quaternion) : Vector3f #

[View source]
def set(x : Float32, y : Float32, z : Float32) #

[View source]
def set(r : Vector3f) #

[View source]
def to_normalized #

Returns a new normalized vector.


[View source]
def to_s #
Description copied from class Object

Returns a nicely readable and concise string representation of this object, typically intended for users.

This method should usually not be overridden. It delegates to #to_s(IO) which can be overridden for custom implementations.

Also see #inspect.


[View source]
def x : Float32 #

[View source]
def x=(x : Float32) #

[View source]
def xy : Vector2f #

[View source]
def xz : Vector2f #

[View source]
def y : Float32 #

[View source]
def y=(y : Float32) #

[View source]
def yx : Vector2f #

[View source]
def yz : Vector2f #

[View source]
def z : Float32 #

[View source]
def z=(z : Float32) #

[View source]
def zx : Vector2f #

[View source]
def zy : Vector2f #

[View source]