Skip to content

Commit 365f23c

Browse files
committed
set mouselook to false by default
1 parent aab70a0 commit 365f23c

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/components/TraitInformation.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export default function TraitInformation({currentVRM, animationManager, lookatMa
1515
const [cullInDistance, setCullInDistance] = useState(0);
1616
const [cullLayer, setCullLayer] = useState(0);
1717
const [animationName, setAnimationName] = useState(animationManager.getCurrentAnimationName());
18-
const [hasMouseLook, setHasMouseLook] = useState(lookatManager.enabled);
18+
const [hasMouseLook, setHasMouseLook] = useState(lookatManager.userActivated);
1919

2020
useEffect(() => {
2121
if (currentVRM != null){

src/library/animationManager.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ class AnimationControl {
2121
this.to = null;
2222
this.from = null;
2323
this.vrm = vrm;
24-
this.animationManager = null;
2524
this.animationManager = animationManager;
2625
this.mixamoModel = null;
2726

@@ -159,7 +158,7 @@ export class AnimationManager{
159158
this.curAnimID = 0;
160159
this.animationControls = [];
161160
this.started = false;
162-
this.mouseLookEnabled = true;
161+
this.mouseLookEnabled = false;
163162

164163
this.mixamoModel = null;
165164
this.mixamoAnimations = null;

src/library/lookatManager.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ export class LookAtManager {
99
this.leftEyeBones = []
1010
this.rightEyesBones = []
1111
this.curMousePos = new THREE.Vector2()
12-
this.enabled = true;
1312

1413
this.hotzoneSection = getHotzoneSection()
15-
this.enabled = true
14+
this.enabled = false;
15+
this.userActivated = false;
1616
this.lookInterest = 1
1717
this.hasInterest = true
1818
this.interestSpeed = 0.3
@@ -58,7 +58,8 @@ export class LookAtManager {
5858
// }, 1000/60);
5959
}
6060
setActive(active){
61-
this.enabled = active;
61+
console.log("is activating")
62+
this.userActivated = active;
6263
}
6364
setCamera(camera){
6465
this.camera = camera
@@ -131,7 +132,7 @@ export class LookAtManager {
131132
const cameraRotationThreshold = localVector.z > 0.; // if camera rotation is not larger than 90
132133
if (this.curMousePos.x > this.hotzoneSection.xStart && this.curMousePos.x < this.hotzoneSection.xEnd &&
133134
this.curMousePos.y > this.hotzoneSection.yStart && this.curMousePos.y < this.hotzoneSection.yEnd &&
134-
cameraRotationThreshold && this.enabled) {
135+
cameraRotationThreshold && this.enabled && this.userActivated) {
135136
this.neckBones.forEach(neck => {
136137
this._moveJoint(neck, this.maxLookPercent.neck)
137138
})

0 commit comments

Comments
 (0)