Unity 全景照片

写在fixedupdate

X轴绕self

Y轴绕world

float offsetx=input.getaxis("Moouse X");

float offsety=input.getaxis("Moouse Y");

rig.transform.rotate(rverter.up*offsety*speed*time.fixeddelatime,space.world);

vrcamera.transform.rotate(rverter.right*offsetx*speed*time.fixeddelatime,space.self);

cameraRotation=viewCamera.localEulerAngles;
Quaternion LimitQua=Quaternion.identity;
If(cameraRotation.x>180 && cameraRotation.x<360-x.rotateLimit)
limitQua=Quaternion.Euler(new Vector3(360-x_rotattelimit,0,0)
viewCamera.localRotation=LimitQua;}

If(cameraRotation.x<180 && cameraRotation.x>x.rotateLimit)
limitQua=Quaternion.Euler(new Vector3(x_rotattelimit,0,0)
viewCamera.localRotation=LimitQua;}

 

gyroscope _gy=input.gyro;
_gy.enabled=true;
vector3 _ro=_gy.rotationRateUnbiased;

 

 

 

 

 

posted @ 2022-08-26 09:58  多见多闻  阅读(63)  评论(0)    收藏  举报