Skip to content

Commit f745292

Browse files
authored
Update RollOffMode.yaml to add the mathematical formulas for RolloffM… (#935)
## Changes 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 This was calculated using [these Rolloff Formulas](https://www.desmos.com/calculator/g7izzry4ze) These are useful as currently, you have to search online for these formulas, with no official documentation for recreating them. ## Checks By submitting your pull request for review, you agree to the following: - [ X ] This contribution was created in whole or in part by me, and I have the right to submit it under the terms of this repository's open source licenses. - [ X ] I understand and agree that this contribution and a record of it are public, maintained indefinitely, and may be redistributed under the terms of this repository's open source licenses. - [ X ] To the best of my knowledge, all proposed changes are accurate. ---------
1 parent e6a1e01 commit f745292

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,26 @@ items:
1515
- name: Inverse
1616
summary: |
1717
Volume attenuates from `Class.Sound.RollOffMinDistance` in an inverse
18-
manner. This option mirrors how sounds attenuate in the real world.
18+
manner, mirroring how sounds attenuate in the real world.
19+
This is done through `Class.Sound.RollOffMinDistance`/`distance`,
20+
where `distance` is the `Datatype.Vector3.Magnitude` between the audio source and the audio listener.
1921
value: 0
2022
tags: []
2123
deprecation_message: ''
2224
- name: Linear
2325
summary: |
2426
Volume attenuates between `Class.Sound.RollOffMinDistance` and
2527
`Class.Sound.RollOffMaxDistance` with a linear relationship.
28+
This is done through (`Class.Sound.RollOffMaxDistance`/`distance`)/(`Class.Sound.RollOffMaxDistance`-`Class.Sound.RollOffMinDistance`),
29+
where `distance` is the `Datatype.Vector3.Magnitude` between the audio source and the audio listener.
2630
value: 1
2731
tags: []
2832
deprecation_message: ''
2933
- name: LinearSquare
3034
summary: |
3135
Volume attenuates between `Class.Sound.RollOffMinDistance` and
3236
`Class.Sound.RollOffMaxDistance` with a linear squared relationship.
37+
This is done through squaring `Linear`.
3338
value: 2
3439
tags: []
3540
deprecation_message: ''
@@ -38,6 +43,7 @@ items:
3843
A hybrid model which follows the `Inverse` model when close to
3944
`Class.Sound.RollOffMinDistance` and the `LinearSquare` model when close
4045
to `Class.Sound.RollOffMaxDistance`.
46+
This is done by taking the lesser of `Inverse` and `LinearSquare`.
4147
value: 3
4248
tags: []
4349
deprecation_message: ''

0 commit comments

Comments
 (0)