Class: Bomp::CollisionInfo
- Inherits:
-
Object
- Object
- Bomp::CollisionInfo
- Defined in:
- lib/bomp.rb
Instance Attribute Summary collapse
-
#goal ⇒ Object
readonly
Returns the value of attribute goal.
-
#item ⇒ Object
readonly
Returns the value of attribute item.
-
#other ⇒ Object
readonly
Returns the value of attribute other.
-
#overlaps ⇒ Object
readonly
Returns the value of attribute overlaps.
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(item, other, goal, overlaps, response) ⇒ CollisionInfo
constructor
A new instance of CollisionInfo.
- #to_s ⇒ Object
Constructor Details
#initialize(item, other, goal, overlaps, response) ⇒ CollisionInfo
Returns a new instance of CollisionInfo.
211 212 213 214 215 216 217 218 219 220 221 |
# File 'lib/bomp.rb', line 211 def initialize(item, other, goal, overlaps, response) @item = item @other = other @goal = goal @overlaps = overlaps @response = response @normal = Vector2[ goal[0] <=> 0, goal[1] <=> 0 ] end |
Instance Attribute Details
#goal ⇒ Object (readonly)
Returns the value of attribute goal.
209 210 211 |
# File 'lib/bomp.rb', line 209 def goal @goal end |
#item ⇒ Object (readonly)
Returns the value of attribute item.
209 210 211 |
# File 'lib/bomp.rb', line 209 def item @item end |
#other ⇒ Object (readonly)
Returns the value of attribute other.
209 210 211 |
# File 'lib/bomp.rb', line 209 def other @other end |
#overlaps ⇒ Object (readonly)
Returns the value of attribute overlaps.
209 210 211 |
# File 'lib/bomp.rb', line 209 def overlaps @overlaps end |
#response ⇒ Object (readonly)
Returns the value of attribute response.
209 210 211 |
# File 'lib/bomp.rb', line 209 def response @response end |
Class Method Details
.[](*args) ⇒ Object
227 228 229 |
# File 'lib/bomp.rb', line 227 def self.[](*args) CollisionInfo.new *args end |
Instance Method Details
#to_s ⇒ Object
223 224 225 |
# File 'lib/bomp.rb', line 223 def to_s [@item, @other, @goal, @overlaps, @response, @normal].to_s end |