I have a camera that I want to toggle position and rotation on click of a button. The position toggles just fine, but the setRotation is way too confusing. When I do setRotation with angles (0,90,0) in initialization it works fine (I got this number from x,y,z of entity from editor).
But the same code on click of a button rotates to a completely weird angle. What am I missing ?
this.app.root.findByName('fpCamera').setRotation(new pc.Quat().setFromEulerAngles(0, 90, 0));
I have a feeling these are not absolute values and something relative is going on, but it’s not very clear how.
I have also tried
setLocalEulerAngles but doesn’t work on an absolute value basis.