File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,9 @@ const m1 = new THREE.Matrix4()
3939const m2 = new THREE . Matrix4 ( )
4040const m3 = new THREE . Matrix4 ( )
4141
42+ const gazeTiltAngle = 10 * DEG2RAD
43+ const gazeTiltAxis = new THREE . Vector3 ( 1 , 0 , 0 ) // X-axis for pitch
44+
4245// TODO: de-dup createVRMFactory.js has a copy
4346const Modes = {
4447 IDLE : 0 ,
@@ -911,6 +914,11 @@ export class PlayerLocal extends Entity {
911914 this . gaze . copy ( FORWARD ) . applyQuaternion ( this . world . xr . camera . quaternion )
912915 } else {
913916 this . gaze . copy ( FORWARD ) . applyQuaternion ( this . cam . quaternion )
917+ if ( ! this . firstPerson ) {
918+ // tilt slightly up in third person as people look from above
919+ v1 . copy ( gazeTiltAxis ) . applyQuaternion ( this . cam . quaternion ) // tilt in cam space
920+ this . gaze . applyAxisAngle ( v1 , gazeTiltAngle ) // positive for upward tilt
921+ }
914922 }
915923
916924 // apply locomotion
Original file line number Diff line number Diff line change @@ -318,13 +318,13 @@ export function createVRMFactory(glb, setupMaterial) {
318318 minAngle : - 30 ,
319319 maxAngle : 30 ,
320320 smoothing : 0.4 ,
321- weight : 0.5 ,
321+ weight : 0.6 ,
322322 } )
323323 aimBone ( 'head' , loco . gazeDir , delta , {
324324 minAngle : - 30 ,
325325 maxAngle : 30 ,
326326 smoothing : 0.4 ,
327- weight : 1 ,
327+ weight : 0.6 ,
328328 } )
329329 }
330330 // tvrm.humanoid.update(elapsed)
You can’t perform that action at this time.
0 commit comments