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



122
123
124
# File 'lib/raylib_helper.rb', line 122

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



118
119
120
# File 'lib/raylib_helper.rb', line 118

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



126
127
128
129
130
131
132
# File 'lib/raylib_helper.rb', line 126

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

#to_aObject



134
135
136
# File 'lib/raylib_helper.rb', line 134

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

#wObject



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

def w = self[:w]

#w=(v) ⇒ Object



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

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

#xObject



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

def x = self[:x]

#x=(v) ⇒ Object



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

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

#yObject



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

def y = self[:y]

#y=(v) ⇒ Object



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

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

#zObject



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

def z = self[:z]

#z=(v) ⇒ Object



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

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