struct Oid::Vector4

Included Modules

Defined in:

oid/resources/vectors/vector4.cr

Constructors

Class Method Summary

Instance Method Summary

Instance methods inherited from module Oid::Vector

!=(other) !=, %(other : Vector) %, *(other : Vector)
*(other : Float64)
*
, **(other : Vector) **, +(other : Vector)
+(other : Float64)
+
, -(other : Vector)
-
-
, /(other : Vector)
/(other : Float64)
/
, ==(other) ==, clone
clone(&b)
clone
, cross(other) cross, distance(other : Vector) distance, dot(other) dot, heading heading, mag mag, magnitude magnitude, normalize normalize, normalize! normalize!, values values, zero! zero!

Constructor Detail

def self.new(x, y, z, w) #

Initializes vector with #x, #y, #z, #w


[View source]
def self.new(angle : Float64, vector : Vector3) #

[View source]
def self.new(pull : JSON::PullParser) #

def self.new(x : Float64 = 0.0, y : Float64 = 0.0, z : Float64 = 0.0, w : Float64 = 1.0) #

[View source]

Class Method Detail

def self.zero #

Zero vector


[View source]

Instance Method Detail

def !=(other : Vector) #

[View source]
def *(other : Vector) #
Description copied from module Oid::Vector

Performs component multiplication (for dot product see #dot)


[View source]
def *(other : Float64) #
Description copied from module Oid::Vector

Performs multiplication


[View source]
def +(other : Float64) #
Description copied from module Oid::Vector

Performs component addition


[View source]
def +(other) #

[View source]
def -(other : Vector) #
Description copied from module Oid::Vector

Performs component subtraction


[View source]
def -(other : Float64) #

[View source]
def - #
Description copied from module Oid::Vector

Returns negated vector


[View source]
def /(other : Vector) #

[View source]
def ==(other : Vector) #

[View source]
def clone #

[View source]
def cross(other) #

Cross product


[View source]
def distance(other : Vector) #

[View source]
def dot(other) #

Dot product


[View source]
def magnitude #

[View source]
def normalize! #
Description copied from module Oid::Vector

Normalizes current vector


[View source]
def to_v3 #

[View source]
def values #

[View source]
def w : Float64 #

[View source]
def w=(w : Float64) #

[View source]
def x : Float64 #

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

[View source]
def y : Float64 #

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

[View source]
def z : Float64 #

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

[View source]
def zero! #

[View source]