class Game::Vector

Included Modules

Defined in:

game/vector.cr

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(pull : JSON::PullParser) #

[View source]
def self.new(x : Float32 | Int32 = 0, y : Float32 | Int32 = 0) #

[View source]

Class Method Detail

def self.collision?(a1 : Vector, a2 : Vector, b1 : Vector, b2 : Vector) #

[View source]
def self.zero #

[View source]

Instance Method Detail

def *(value : Int32 | Float32) #

[View source]
def *(v : Vector) #

[View source]
def +(value : Int32 | Float32) #

[View source]
def +(v : Vector) #

[View source]
def -(value : Int32 | Float32) #

[View source]
def -(v : Vector) #

[View source]
def /(value : Int32 | Float32) #

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

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

[View source]
def add(v : Vector) : Vector #

[View source]
def clone #

[View source]
def collision?(tri : Triangle) #

[View source]
def dot(v : Vector) #

[View source]
def length #

[View source]
def subtract(v : Vector) : Vector #

[View source]
def to_s(io : IO) #
Description copied from class Reference

Appends a short String representation of this object which includes its class name and its object address.

class Person
  def initialize(@name : String, @age : Int32)
  end
end

Person.new("John", 32).to_s # => #<Person:0x10a199f20>

[View source]
def to_struct #

[View source]
def x : Int32 | Float32 #

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

[View source]
def y : Int32 | Float32 #

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

[View source]
def zero? #

[View source]