Quaternion.js 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. function Quaternion() {
  2. }
  3. Quaternion.prototype.setFromMatrix = function(_mat) {
  4. Polycode.Quaternion_setFromMatrix(this.__ptr, _mat)
  5. }
  6. Quaternion.prototype.Dot = function(rkQ) {
  7. Polycode.Quaternion_Dot(this.__ptr, rkQ)
  8. }
  9. Quaternion.prototype.Log = function() {
  10. Polycode.Quaternion_Log(this.__ptr)
  11. }
  12. Quaternion.prototype.Exp = function() {
  13. Polycode.Quaternion_Exp(this.__ptr)
  14. }
  15. Quaternion.prototype.Norm = function() {
  16. Polycode.Quaternion_Norm(this.__ptr)
  17. }
  18. Quaternion.prototype.Normalize = function() {
  19. Polycode.Quaternion_Normalize(this.__ptr)
  20. }
  21. Quaternion.prototype.lookAt = function(D,upVector) {
  22. Polycode.Quaternion_lookAt(this.__ptr, D,upVector)
  23. }
  24. Quaternion.prototype.createFromMatrix = function(matrix) {
  25. Polycode.Quaternion_createFromMatrix(this.__ptr, matrix)
  26. }
  27. Quaternion.prototype.Inverse = function() {
  28. Polycode.Quaternion_Inverse(this.__ptr)
  29. }
  30. Quaternion.prototype.set = function(w,x,y,z) {
  31. Polycode.Quaternion_set(this.__ptr, w,x,y,z)
  32. }
  33. Quaternion.prototype.InvSqrt = function(x) {
  34. Polycode.Quaternion_InvSqrt(this.__ptr, x)
  35. }
  36. Quaternion.prototype.fromAxes = function(az,ay,ax) {
  37. Polycode.Quaternion_fromAxes(this.__ptr, az,ay,ax)
  38. }
  39. Quaternion.prototype.fromAngleAxis = function(rfAngle,rkAxis) {
  40. Polycode.Quaternion_fromAngleAxis(this.__ptr, rfAngle,rkAxis)
  41. }
  42. Quaternion.prototype.toEulerAngles = function() {
  43. Polycode.Quaternion_toEulerAngles(this.__ptr)
  44. }
  45. Quaternion.prototype.toAngleAxis = function(rfAngle,rkAxis) {
  46. Polycode.Quaternion_toAngleAxis(this.__ptr, rfAngle,rkAxis)
  47. }
  48. Quaternion.prototype.createFromAxisAngle = function(x,y,z,degrees) {
  49. Polycode.Quaternion_createFromAxisAngle(this.__ptr, x,y,z,degrees)
  50. }
  51. Quaternion.prototype.createMatrix = function() {
  52. Polycode.Quaternion_createMatrix(this.__ptr)
  53. }
  54. Quaternion.prototype.applyTo = function(v) {
  55. Polycode.Quaternion_applyTo(this.__ptr, v)
  56. }