let m = new pc.Mat4();
pc.Quat.prototype.lookAt = function(from, to, up) {
m.setLookAt(from, to, up || pc.Vec3.UP)
this.setFromMat4(m)
return this;
}
But when I use it to set the rotation on my game object, it’s always off by 90deg clockwise. In other words, my character’s left arm is pointing at the target, not his chest. Any idea what could be causing this?
I guess it’s working fine in that case. I was expecting the positve X axis to point at the target. I’ll just make my model a children of the entity and rotate it 90degrees and I’ll be in business.