console.log(this.calculateAoa(this.entity, this.entity) * (180 / Math.PI));
LiftGen.prototype.calculateAoa = function(entity, surface) {
var velocityDir = entity.rigidbody.linearVelocity;
var forward = surface.forward;
var dotProduct = velocityDir.dot(forward);
var angleOfAttack = Math.acos(dotProduct)
return angleOfAttack;
};
I have zero clue as to why this gives inaccurate responses, so any help would be greatly appreciated.