I'm short 90deg on my rotation

I’ve extend pc.Quat this way.

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?

LookAt makes negative (or positive, I can’t remember) point to the ‘to’ position. Is the Z axis of the arm pointing where you expect it to be?

Is that not the desired behaviour? Its a bit difficult to know without context :stuck_out_tongue:

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.