Class: Raylib::BoundingBox

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

Overview

BoundingBox

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.create(*args) ⇒ Object



195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
# File 'lib/raylib_helper.rb', line 195

def self.create(*args)
  case args.size
  when 2
    instance = BoundingBox.new
    instance[:min] = args[0] # min
    instance[:max] = args[1] # max
    instance
  when 6
    instance = BoundingBox.new
    instance[:min] = Vector3.create(args[0], args[1], args[2]) # min_x, min_y, min_z
    instance[:max] = Vector3.create(args[3], args[4], args[5]) # max_x, max_y, max_z
    instance
  else
    raise ArgumentError.new 'BoundingBox.create : Number of arguments must be 2 or 6'
  end
end

Instance Method Details

#maxObject



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

def max = self[:max]

#max=(v) ⇒ Object



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

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

#minObject



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

def min = self[:min]

#min=(v) ⇒ Object



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

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

#with_max(x, y, z) ⇒ Object



217
218
219
220
# File 'lib/raylib_helper.rb', line 217

def with_max(x, y, z)
  self[:max].set(x, y, z)
  self
end

#with_min(x, y, z) ⇒ Object



212
213
214
215
# File 'lib/raylib_helper.rb', line 212

def with_min(x, y, z)
  self[:min].set(x, y, z)
  self
end