Class: Raylib::Vector4

Inherits:
FFI::Struct
  • Object
show all
Defined in:
lib/raylib/core/structs/vector4.rb

Overview

Vector4, 4 components

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

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



11
12
13
14
15
16
17
18
# File 'lib/raylib/core/structs/vector4.rb', line 11

def self.create(x, y, z, w)
  new.tap do |instance|
    instance[:x] = x
    instance[:y] = y
    instance[:z] = z
    instance[:w] = w
  end
end

Instance Method Details

#to_sObject



20
21
22
# File 'lib/raylib/core/structs/vector4.rb', line 20

def to_s
  "Raylib::Vector4##{object_id} x=#{x} y=#{y} z=#{z} w=#{w}"
end

#wFloat

Vector w component

Returns:

  • (Float)

    w



53
# File 'lib/raylib/core/structs/vector4.rb', line 53

def w = self[:w]

#w=(new_w) ⇒ Object

Sets Vector w component



56
57
58
# File 'lib/raylib/core/structs/vector4.rb', line 56

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

#xFloat

Vector x component

Returns:

  • (Float)

    x



26
# File 'lib/raylib/core/structs/vector4.rb', line 26

def x = self[:x]

#x=(new_x) ⇒ Object

Sets Vector x component



29
30
31
# File 'lib/raylib/core/structs/vector4.rb', line 29

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

#yFloat

Vector y component

Returns:

  • (Float)

    y



35
# File 'lib/raylib/core/structs/vector4.rb', line 35

def y = self[:y]

#y=(new_y) ⇒ Object

Sets Vector y component



38
39
40
# File 'lib/raylib/core/structs/vector4.rb', line 38

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

#zFloat

Vector z component

Returns:

  • (Float)

    z



44
# File 'lib/raylib/core/structs/vector4.rb', line 44

def z = self[:z]

#z=(new_z) ⇒ Object

Sets Vector z component



47
48
49
# File 'lib/raylib/core/structs/vector4.rb', line 47

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