Hello!
I was modifying the default orbit-camera script to make it ES6 compliant when I noticed something:
OrbitCamera.prototype._updatePosition = function () {
// Work out the camera position based on the pivot point, pitch, yaw and distance
this.entity.setLocalPosition(0, 0, 0);
this.entity.setLocalEulerAngles(this._pitch, this._yaw, 0);
var position = this.entity.getPosition();
position.copy(this.entity.forward);
position.scale(-this._distance);
position.add(this.pivotPoint);
this.entity.setPosition(position);
};
Position is Vec3 and that class doesn’t have a method called scale. Where does it come from? What does it do?
(I replaced it with a mulScalar)