Class: Raylib::RayCollision
- Inherits:
-
FFI::Struct
- Object
- FFI::Struct
- Raylib::RayCollision
- Defined in:
- lib/raylib/core/structs/ray_collision.rb
Overview
RayCollision, ray hit information
Class Method Summary collapse
Instance Method Summary collapse
-
#distance ⇒ Float
Distance to the nearest hit.
-
#distance=(new_distance) ⇒ Object
Sets Distance to the nearest hit.
-
#hit ⇒ bool
Did the ray hit something?.
-
#hit=(new_hit) ⇒ Object
Sets Did the ray hit something?.
-
#normal ⇒ Vector3
Surface normal of hit.
-
#normal=(new_normal) ⇒ Object
Sets Surface normal of hit.
-
#point ⇒ Vector3
Point of the nearest hit.
-
#point=(new_point) ⇒ Object
Sets Point of the nearest hit.
- #to_s ⇒ Object
Class Method Details
.create(hit, distance, point, normal) ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/raylib/core/structs/ray_collision.rb', line 11 def self.create(hit, distance, point, normal) new.tap do |instance| instance[:hit] = hit instance[:distance] = distance instance[:point] = point instance[:normal] = normal end end |
Instance Method Details
#distance ⇒ Float
Distance to the nearest hit
35 |
# File 'lib/raylib/core/structs/ray_collision.rb', line 35 def distance = self[:distance] |
#distance=(new_distance) ⇒ Object
Sets Distance to the nearest hit
38 39 40 |
# File 'lib/raylib/core/structs/ray_collision.rb', line 38 def distance=(new_distance) self[:distance] = new_distance end |
#hit ⇒ bool
Did the ray hit something?
26 |
# File 'lib/raylib/core/structs/ray_collision.rb', line 26 def hit = self[:hit] |
#hit=(new_hit) ⇒ Object
Sets Did the ray hit something?
29 30 31 |
# File 'lib/raylib/core/structs/ray_collision.rb', line 29 def hit=(new_hit) self[:hit] = new_hit end |
#normal ⇒ Vector3
Surface normal of hit
53 |
# File 'lib/raylib/core/structs/ray_collision.rb', line 53 def normal = self[:normal] |
#normal=(new_normal) ⇒ Object
Sets Surface normal of hit
56 57 58 |
# File 'lib/raylib/core/structs/ray_collision.rb', line 56 def normal=(new_normal) self[:normal] = new_normal end |
#point ⇒ Vector3
Point of the nearest hit
44 |
# File 'lib/raylib/core/structs/ray_collision.rb', line 44 def point = self[:point] |
#point=(new_point) ⇒ Object
Sets Point of the nearest hit
47 48 49 |
# File 'lib/raylib/core/structs/ray_collision.rb', line 47 def point=(new_point) self[:point] = new_point end |
#to_s ⇒ Object
20 21 22 |
# File 'lib/raylib/core/structs/ray_collision.rb', line 20 def to_s "Raylib::RayCollision##{object_id} hit=#{hit} distance=#{distance} point=#{point} normal=#{normal}" end |