Class: Raylib::Vector4

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

Overview

Vector4, 4 components

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.copy_from(vec) ⇒ Object



141
142
143
# File 'lib/raylib_helper.rb', line 141

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

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



137
138
139
# File 'lib/raylib_helper.rb', line 137

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

Instance Method Details

#set(x, y, z, w) ⇒ Object



145
146
147
148
149
150
151
# File 'lib/raylib_helper.rb', line 145

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

#to_aObject



153
154
155
# File 'lib/raylib_helper.rb', line 153

def to_a
  [x, y, z, w]
end

#wObject



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

def w = self[:w]

#w=(v) ⇒ Object



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

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

#xObject



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

def x = self[:x]

#x=(v) ⇒ Object



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

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

#yObject



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

def y = self[:y]

#y=(v) ⇒ Object



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

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

#zObject



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

def z = self[:z]

#z=(v) ⇒ Object



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

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