Hello!
Trying to get object to tween by -90 degrees every time object is clicked on.
Doing this directly with Euler angles results in Gimbal Lock
Below I have converted to Quaternion however when calling this tween multiple times the object scales strangly and rotates.
Any thoughts as to what is causing an unwanted scaling behaviour when code is called multiple times?
var relativeRotationQuaternion = new pc.Quat().setFromEulerAngles(0, -90, 0);
var targetRotation = this.entity.getLocalRotation().clone();
targetRotation.mul(relativeRotationQuaternion);
this.tween = this.entity.tween(this.entity.getLocalRotation())
.to(targetRotation, 1.5, pc.Linear)
.delay(0)
.loop(false)
.yoyo(false)
.start();