Class: Raylib::Ray

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

Overview

Ray, ray for raycasting

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.create(position, direction) ⇒ Object



9
10
11
12
13
14
# File 'lib/raylib/core/structs/ray.rb', line 9

def self.create(position, direction)
  new.tap do |instance|
    instance[:position] = position
    instance[:direction] = direction
  end
end

Instance Method Details

#directionVector3

Ray direction

Returns:



31
# File 'lib/raylib/core/structs/ray.rb', line 31

def direction = self[:direction]

#direction=(new_direction) ⇒ Object

Sets Ray direction



34
35
36
# File 'lib/raylib/core/structs/ray.rb', line 34

def direction=(new_direction)
  self[:direction] = new_direction
end

#positionVector3

Ray position (origin)

Returns:



22
# File 'lib/raylib/core/structs/ray.rb', line 22

def position = self[:position]

#position=(new_position) ⇒ Object

Sets Ray position (origin)



25
26
27
# File 'lib/raylib/core/structs/ray.rb', line 25

def position=(new_position)
  self[:position] = new_position
end

#to_sObject



16
17
18
# File 'lib/raylib/core/structs/ray.rb', line 16

def to_s
  "Raylib::Ray##{object_id} position=#{position} direction=#{direction}"
end