@@ -11,8 +11,8 @@ import {
11
11
} from "./physics" ;
12
12
import {
13
13
MinMax ,
14
- AppData ,
15
14
ModelId ,
15
+ OverlayConfig ,
16
16
ThrowDirection ,
17
17
ItemImageConfig ,
18
18
ModelCalibration ,
@@ -35,7 +35,7 @@ export function setPhysicsEngineConfig(config: PhysicsEngineConfig) {
35
35
* Throws an item
36
36
*
37
37
* @param socket Socket for getting model position and sending impact flinches to VTube studio
38
- * @param appData Global app data settings
38
+ * @param overlayConfig Global app data settings
39
39
* @param modelCalibration Calibration data for available models
40
40
* @param modelParameters Parameters for the current model
41
41
* @param config Configuration for the thrown item
@@ -46,7 +46,7 @@ export function setPhysicsEngineConfig(config: PhysicsEngineConfig) {
46
46
*/
47
47
export async function throwItem (
48
48
socket : VTubeStudioWebSocket ,
49
- appData : AppData ,
49
+ overlayConfig : OverlayConfig ,
50
50
modelCalibration : Map < ModelId , ModelCalibration > ,
51
51
modelParameters : ModelParameters ,
52
52
config : ItemWithSoundIds ,
@@ -64,7 +64,7 @@ export async function throwItem(
64
64
// Model is not available
65
65
if ( ! modelPosition ) return ;
66
66
67
- const { throwables_config : throwables } = appData ;
67
+ const { throwables_config : throwables } = overlayConfig ;
68
68
69
69
// Determine scale of the model relative to the calibrated minimum and maximum sizes
70
70
const modelScale =
@@ -96,7 +96,7 @@ export async function throwItem(
96
96
if ( windupAudio !== null ) {
97
97
try {
98
98
windupAudio . sound . volume =
99
- appData . sounds_config . global_volume * windupAudio . config . volume ;
99
+ overlayConfig . sounds_config . global_volume * windupAudio . config . volume ;
100
100
windupAudio . sound . play ( ) ;
101
101
} catch ( err ) {
102
102
console . error ( "failed to play windup audio" , err ) ;
@@ -149,7 +149,7 @@ export async function throwItem(
149
149
// Handle point of impact
150
150
handleThrowableImpact (
151
151
socket ,
152
- appData ,
152
+ overlayConfig ,
153
153
modelParameters ,
154
154
config ,
155
155
impactAudio ,
@@ -158,7 +158,7 @@ export async function throwItem(
158
158
) ;
159
159
160
160
// No physics to apply
161
- if ( ! appData . physics_config . enabled ) {
161
+ if ( ! overlayConfig . physics_config . enabled ) {
162
162
// Wait remaining duration before removing
163
163
await sleep ( throwables . duration / 2 ) ;
164
164
// Remove after complete
@@ -169,7 +169,7 @@ export async function throwItem(
169
169
170
170
// Initialize the physics engine
171
171
if ( physicsEngine === null ) {
172
- const { fps, gravity_multiplier } = appData . physics_config ;
172
+ const { fps, gravity_multiplier } = overlayConfig . physics_config ;
173
173
174
174
physicsEngine = createPhysicsEngine ( {
175
175
fps : fps ,
@@ -182,7 +182,8 @@ export async function throwItem(
182
182
pivot . style . transform = "" ;
183
183
thrown . style . transform = "" ;
184
184
185
- const { horizontal_multiplier, vertical_multiplier } = appData . physics_config ;
185
+ const { horizontal_multiplier, vertical_multiplier } =
186
+ overlayConfig . physics_config ;
186
187
187
188
const randomVelocity = Math . random ( ) ;
188
189
@@ -245,7 +246,7 @@ function isRandomDirectionLeft(
245
246
* Handles the point of impact for a throwable hitting the model
246
247
*
247
248
* @param socket Socket for sending impact flinches to VTube studio
248
- * @param appData Global app data settings
249
+ * @param overlayConfig Global app data settings
249
250
* @param modelParameters Parameters for the current model
250
251
* @param config Configuration for the thrown item
251
252
* @param impactAudio Audio element to play when the item impacts the target
@@ -254,7 +255,7 @@ function isRandomDirectionLeft(
254
255
*/
255
256
function handleThrowableImpact (
256
257
socket : VTubeStudioWebSocket ,
257
- appData : AppData ,
258
+ overlayConfig : OverlayConfig ,
258
259
modelParameters : ModelParameters ,
259
260
config : ItemWithSoundIds ,
260
261
impactAudio : LoadedSoundData | null ,
@@ -265,7 +266,7 @@ function handleThrowableImpact(
265
266
if ( impactAudio !== null ) {
266
267
try {
267
268
impactAudio . sound . volume =
268
- appData . sounds_config . global_volume * impactAudio . config . volume ;
269
+ overlayConfig . sounds_config . global_volume * impactAudio . config . volume ;
269
270
270
271
impactAudio . sound . play ( ) ;
271
272
} catch ( err ) {
@@ -278,7 +279,7 @@ function handleThrowableImpact(
278
279
// Make the VTuber model flinch from the impact
279
280
flinch ( socket , modelParameters , {
280
281
angle,
281
- eyeState : appData . model_config . eyes_on_hit ,
282
+ eyeState : overlayConfig . model_config . eyes_on_hit ,
282
283
magnitude : image . weight ,
283
284
leftSide,
284
285
returnSpeed : 0.3 ,
0 commit comments