A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/AlmasB/FXGL/commit/6a1bf5632 below:

updating rotationX and rotationY now correctly updates direction… · AlmasB/FXGL@6a1bf56 · GitHub

@@ -55,6 +55,16 @@ class TransformComponent(x: Double, y: Double, angle: Double, scaleX: Double, sc

55 55

private val propRotationY = SimpleDoubleProperty(0.0)

56 56

private val propRotationZ = SimpleDoubleProperty(angle)

57 57 58 +

init {

59 +

propRotationX.addListener { _, _, _ ->

60 +

updateDirection()

61 +

}

62 + 63 +

propRotationY.addListener { _, _, _ ->

64 +

updateDirection()

65 +

}

66 +

}

67 + 58 68

var x: Double

59 69

get() = propX.value

60 70

set(value) { propX.value = value }

@@ -315,27 +325,19 @@ class TransformComponent(x: Double, y: Double, angle: Double, scaleX: Double, sc

315 325

private set

316 326 317 327

fun lookUpBy(angle: Double) {

318 -

propRotationX.value += angle

319 - 320 -

updateDirection()

328 +

rotationX += angle

321 329

}

322 330 323 331

fun lookDownBy(angle: Double) {

324 -

propRotationX.value -= angle

325 - 326 -

updateDirection()

332 +

rotationX -= angle

327 333

}

328 334 329 335

fun lookLeftBy(angle: Double) {

330 -

propRotationY.value -= angle

331 - 332 -

updateDirection()

336 +

rotationY -= angle

333 337

}

334 338 335 339

fun lookRightBy(angle: Double) {

336 -

propRotationY.value += angle

337 - 338 -

updateDirection()

340 +

rotationY += angle

339 341

}

340 342 341 343

fun lookAt(point: Point3D) {


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4