fix: correct label text for mouse interaction toggle and improve comments

This commit is contained in:
Akatsh1
2025-12-21 15:26:38 +08:00
parent 5c06429ef8
commit 6dabeae6be
2 changed files with 5 additions and 5 deletions

View File

@@ -57,7 +57,7 @@
<label class="toggle-switch">
<input type="checkbox" id="mouse-interaction-toggle" checked />
<span class="slider"></span>
<span class="label-text">MouseInteract</span>
<span class="label-text">MouseInteraction</span>
</label>
<label class="toggle-switch" id="device-motion-container">

View File

@@ -36,6 +36,9 @@ export class MarbleSystem {
private container: HTMLElement;
private marbles: Marble[] = [];
// Mouse interaction enabled state
private mouseInteractionEnabled: boolean = true;
// Subsystems
private mouseInteraction: MouseInteraction;
private deviceOrientationInteraction: DeviceOrientationInteraction;
@@ -173,7 +176,7 @@ export class MarbleSystem {
for (let i = 0; i < subSteps; i++) {
// Apply mouse force field
if (this.mouseInteractionEnabled) { //mouse-interavtion-trigger controll
if (this.mouseInteractionEnabled) { //mouse-interaction-trigger controll
for (const marble of this.marbles) {
if (this.mouseInteraction.shouldApplyForce(marble)) {
this.mouseInteraction.applyForce(marble, subDt);
@@ -358,9 +361,6 @@ export class MarbleSystem {
this.deviceOrientationInteraction.updateConfig({ enable: enabled });
}
// Mouse interaction enabled state
private mouseInteractionEnabled: boolean = true;
// Toggle mouse interaction
public setMouseInteraction(enabled: boolean): void {
this.mouseInteractionEnabled = enabled;