Method: Processing::Vector#limit
- Defined in:
- lib/processing/vector.rb
#limit(max) ⇒ Vector
Changes the length of the vector if it’s length is greater than the max value.
464 465 466 467 |
# File 'lib/processing/vector.rb', line 464 def limit(max) setMag max if magSq > max ** 2 self end |