Class: Raylib::Vector3

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

Overview

Vector3, 3 components

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.create(x, y, z) ⇒ Object



10
11
12
13
14
15
16
# File 'lib/raylib/core/structs/vector3.rb', line 10

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

Instance Method Details

#to_sObject



18
19
20
# File 'lib/raylib/core/structs/vector3.rb', line 18

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

#xFloat

Vector x component

Returns:

  • (Float)

    x



24
# File 'lib/raylib/core/structs/vector3.rb', line 24

def x = self[:x]

#x=(new_x) ⇒ Object

Sets Vector x component



27
28
29
# File 'lib/raylib/core/structs/vector3.rb', line 27

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

#yFloat

Vector y component

Returns:

  • (Float)

    y



33
# File 'lib/raylib/core/structs/vector3.rb', line 33

def y = self[:y]

#y=(new_y) ⇒ Object

Sets Vector y component



36
37
38
# File 'lib/raylib/core/structs/vector3.rb', line 36

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

#zFloat

Vector z component

Returns:

  • (Float)

    z



42
# File 'lib/raylib/core/structs/vector3.rb', line 42

def z = self[:z]

#z=(new_z) ⇒ Object

Sets Vector z component



45
46
47
# File 'lib/raylib/core/structs/vector3.rb', line 45

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