Skip to content

Commit 665fc85

Browse files
authored
Update RollOffMode.yaml to add the mathematical formulas for RolloffModes
Added the internal mathematical formulas for all of the RolloffMode Enums, which allows the reader to easily replicate how sound volume is calculated to replicate Roblox's Sound Systems
1 parent 4db06a8 commit 665fc85

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

content/en-us/reference/engine/enums/RollOffMode.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,23 @@ items:
1616
summary: |
1717
Volume attenuates from `Class.Sound.RollOffMinDistance` in an inverse
1818
manner. This option mirrors how sounds attenuate in the real world.
19+
This is done through `Class.Sound.RollOffMinDistance`/`Distance`
1920
value: 0
2021
tags: []
2122
deprecation_message: ''
2223
- name: Linear
2324
summary: |
2425
Volume attenuates between `Class.Sound.RollOffMinDistance` and
2526
`Class.Sound.RollOffMaxDistance` with a linear relationship.
27+
This is done through (`Class.Sound.RollOffMaxDistance`/`Distance`)/(`Class.Sound.RollOffMaxDistance`-`Class.Sound.RollOffMinDistance`)
2628
value: 1
2729
tags: []
2830
deprecation_message: ''
2931
- name: LinearSquare
3032
summary: |
3133
Volume attenuates between `Class.Sound.RollOffMinDistance` and
3234
`Class.Sound.RollOffMaxDistance` with a linear squared relationship.
35+
This is done through Squaring `Linear`
3336
value: 2
3437
tags: []
3538
deprecation_message: ''
@@ -38,6 +41,7 @@ items:
3841
A hybrid model which follows the `Inverse` model when close to
3942
`Class.Sound.RollOffMinDistance` and the `LinearSquare` model when close
4043
to `Class.Sound.RollOffMaxDistance`.
44+
This is done through `Libraries.math.min`((`Class.Sound.RollOffMinDistance`/`Distance`)*`LinearSquare`)
4145
value: 3
4246
tags: []
4347
deprecation_message: ''

0 commit comments

Comments
 (0)