[orx-shapes] Add custom tensions to HobbyCurve and related 2D/3D demos and tests

This commit is contained in:
Edwin Jakobs
2025-08-16 16:27:03 +02:00
parent 72b02ce585
commit e6997a968f
5 changed files with 98 additions and 26 deletions

View File

@@ -29,7 +29,7 @@ fun main() = application {
val hobby3D = hobbyCurve(
pts.map { it.xy0 + Vector3(0.0, 0.0, Double.uniform(-360.0, 360.0, r)) },
true,
tensions = { chordIndex: Int ->
tensions = { chordIndex, inAngle, outAngle ->
Pair(
cos(seconds + chordIndex * 0.1) * 0.5 + 0.5,
cos(seconds + (1.0 + chordIndex) * 0.1) * 0.5 + 0.5