y > rectangle.y + rectangle.height || \r
y + height < rectangle.y);\r
}\r
+\r
+ public void set (int x, int y, int width, int height) {\r
+ this.x = x;\r
+ this.y = y;\r
+ this.width = width;\r
+ this.height = height; \r
+ }\r
}\r
\r
return this;\r
}\r
+ \r
+ /**\r
+ * Linearly interpolates between this vector and the target vector by alpha which is in the range [0,1]. The result is stored\r
+ * in this vector.\r
+ * \r
+ * @param target The target vector\r
+ * @param alpha The interpolation coefficient\r
+ * @return This vector for chaining.\r
+ */\r
+ public Vector2 lerp (Vector2 target, float alpha) {\r
+ Vector2 r = this.mul(1.0f - alpha);\r
+ r.add(target.tmp().mul(alpha));\r
+ return r;\r
+ }\r
}\r