mirror of
https://gitlab.com/cc-ru/ocelot/ocelot-desktop.git
synced 2025-12-20 11:09:20 +01:00
if is an expression; use that
This commit is contained in:
parent
c06b048393
commit
d1d2deddff
@ -11,11 +11,9 @@ trait PositionalSoundSourcesNode extends Node {
|
||||
override def update(): Unit = {
|
||||
super.update()
|
||||
|
||||
var soundPosition: Vector3D = null
|
||||
|
||||
// Calculating position of sound source relative to center of workspace
|
||||
// but only if corresponding setting is enabled
|
||||
if (Settings.get.soundPositional) {
|
||||
val soundPosition = if (Settings.get.soundPositional) {
|
||||
val rootWidthHalf = OcelotDesktop.root.width / 2
|
||||
val rootHeightHalf = OcelotDesktop.root.height / 2
|
||||
|
||||
@ -26,13 +24,13 @@ trait PositionalSoundSourcesNode extends Node {
|
||||
// large monitors the sound may become too "non-audiophile"
|
||||
val limit = 0.05f
|
||||
|
||||
soundPosition = Vector3D(
|
||||
Vector3D(
|
||||
(nodeCenterX - rootWidthHalf) / rootWidthHalf * limit,
|
||||
(nodeCenterY - rootHeightHalf) / rootHeightHalf * limit,
|
||||
0,
|
||||
)
|
||||
} else {
|
||||
soundPosition = Vector3D.Zero
|
||||
Vector3D.Zero
|
||||
}
|
||||
|
||||
for (soundSource <- soundSources)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user