mirror of
https://github.com/101island/lolisland.us.git
synced 2026-03-01 03:49:42 +08:00
fix: correct label text for mouse interaction toggle and improve comments
This commit is contained in:
@@ -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">
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user