mirror of
https://github.com/cyberarm/cyberarm_engine.git
synced 2026-03-22 12:06:13 +00:00
Added Vector#lerp
This commit is contained in:
@@ -162,6 +162,10 @@ module CyberarmEngine
|
||||
@x + @y + @z
|
||||
end
|
||||
|
||||
def lerp(other, factor)
|
||||
(self - other) * factor.clamp(0.0, 1.0)
|
||||
end
|
||||
|
||||
# 2D distance using X and Y
|
||||
def distance(other)
|
||||
Math.sqrt((@x-other.x)**2 + (@y-other.y)**2)
|
||||
|
||||
Reference in New Issue
Block a user