draws a curve that starts by heading in the `theta1` angle for a distance of roughly `r1` then ends up heading to `destination` coming in at angle `theta2` from roughly `r2` away
(float r1, float theta1, float r2, float theta2, Vec2 destination)
| 375 | Vec2 a = last().to.toVec2(); |
| 376 | |
| 377 | Vec2 d = Vec2.sub(destination, a, new Vec2()); |
| 378 | |
| 379 | Vec2 c1 = new Vec2(d).mul(r1 / 3); |
| 380 | Vec2 c2 = new Vec2(d).mul(-r2 / 3); |
| 381 | |
| 382 | c1 = new Quat().setAngleAxis(Math.PI * theta1 / 180, new Vec3(0, 0, 1)) |
| 383 | .transform(c1.toVec3()) |
| 384 | .toVec2(); |
| 385 | c2 = new Quat().setAngleAxis(Math.PI * theta2 / 180, new Vec3(0, 0, 1)) |
| 386 | .transform(c2.toVec3()) |
| 387 | .toVec2(); |
| 388 | |
| 389 | Vec2.add(c1, a, c1); |
| 390 | Vec2.add(c2, destination, c2); |
| 391 | |
| 392 | cubicTo(c1, c2, destination); |
| 393 | return this; |
| 394 | } |
| 395 | |
| 396 | public FLine polarCubicTo3(float r1, float theta1, float r2, float theta2, Vec3 destination) { |
| 397 | |
| 398 | if (nodes.size() == 0) |
| 399 | return moveTo(destination); |
| 400 | |
| 401 | Vec3 a = last().to; |
| 402 | |
| 403 | Vec3 d = Vec3.sub(destination, a, new Vec3()); |
| 404 |