Class: Moon::SAT::Response

Inherits:
Object show all
Defined in:
lib/moon/packages/physics/sat.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeResponse

Returns a new instance of Response.


161
162
163
164
165
166
# File 'lib/moon/packages/physics/sat.rb', line 161

def initialize
  @a, @b = nil, nil
  @overlap_v = Moon::Vector2.zero
  @overlap_n = Moon::Vector2.zero
  clear
end

Instance Attribute Details

#aObject

Returns the value of attribute a


148
149
150
# File 'lib/moon/packages/physics/sat.rb', line 148

def a
  @a
end

#a_in_bBoolean

Returns:


157
158
159
# File 'lib/moon/packages/physics/sat.rb', line 157

def a_in_b
  @a_in_b
end

#bObject

Returns the value of attribute b


149
150
151
# File 'lib/moon/packages/physics/sat.rb', line 149

def b
  @b
end

#b_in_aBoolean

Returns:


159
160
161
# File 'lib/moon/packages/physics/sat.rb', line 159

def b_in_a
  @b_in_a
end

#overlapInteger

Returns:


155
156
157
# File 'lib/moon/packages/physics/sat.rb', line 155

def overlap
  @overlap
end

#overlap_nMoon::Vector2

Returns:


153
154
155
# File 'lib/moon/packages/physics/sat.rb', line 153

def overlap_n
  @overlap_n
end

#overlap_vMoon::Vector2

Returns:


151
152
153
# File 'lib/moon/packages/physics/sat.rb', line 151

def overlap_v
  @overlap_v
end

Instance Method Details

#clearObject


168
169
170
171
172
173
# File 'lib/moon/packages/physics/sat.rb', line 168

def clear
  @a_in_b = true
  @b_in_a = true
  @overlap = 0xFFFF
  self
end