Class: Raylib::Vector3

Inherits:
FFI::Struct
  • Object
show all
Defined in:
lib/raylib_main.rb,
lib/raylib_helper.rb

Overview

Vector3, 3 components

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.copy_from(vec) ⇒ Object



101
102
103
# File 'lib/raylib_helper.rb', line 101

def self.copy_from(vec)
  Vector3.create(vec[:x], vec[:y], vec[:z])
end

.create(x = 0, y = 0, z = 0) ⇒ Object



97
98
99
# File 'lib/raylib_helper.rb', line 97

def self.create(x = 0, y = 0, z = 0)
  Vector3.new.set(x, y, z)
end

Instance Method Details

#set(x, y, z) ⇒ Object



105
106
107
108
109
110
# File 'lib/raylib_helper.rb', line 105

def set(x, y, z)
  self[:x] = x
  self[:y] = y
  self[:z] = z
  self
end

#to_aObject



112
113
114
# File 'lib/raylib_helper.rb', line 112

def to_a
  [x, y, z]
end

#xObject



434
# File 'lib/raylib_main.rb', line 434

def x = self[:x]

#x=(v) ⇒ Object



435
# File 'lib/raylib_main.rb', line 435

def x=(v) self[:x] = v end

#yObject



436
# File 'lib/raylib_main.rb', line 436

def y = self[:y]

#y=(v) ⇒ Object



437
# File 'lib/raylib_main.rb', line 437

def y=(v) self[:y] = v end

#zObject



438
# File 'lib/raylib_main.rb', line 438

def z = self[:z]

#z=(v) ⇒ Object



439
# File 'lib/raylib_main.rb', line 439

def z=(v) self[:z] = v end