Rotation.js 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. function Rotation() {
  2. Object.defineProperties(this, {
  3. 'pitch': { enumerable: true, configurable: true, get: Rotation.prototype.__get_pitch, set: Rotation.prototype.__set_pitch},
  4. 'yaw': { enumerable: true, configurable: true, get: Rotation.prototype.__get_yaw, set: Rotation.prototype.__set_yaw},
  5. 'roll': { enumerable: true, configurable: true, get: Rotation.prototype.__get_roll, set: Rotation.prototype.__set_roll}
  6. })
  7. }
  8. Rotation.prototype.__get_pitch = function() {
  9. return Polycode.Rotation__get_pitch(this.__ptr)
  10. }
  11. Rotation.prototype.__set_pitch = function(val) {
  12. Polycode.Rotation__set_pitch(this.__ptr, val)
  13. }
  14. Rotation.prototype.__get_yaw = function() {
  15. return Polycode.Rotation__get_yaw(this.__ptr)
  16. }
  17. Rotation.prototype.__set_yaw = function(val) {
  18. Polycode.Rotation__set_yaw(this.__ptr, val)
  19. }
  20. Rotation.prototype.__get_roll = function() {
  21. return Polycode.Rotation__get_roll(this.__ptr)
  22. }
  23. Rotation.prototype.__set_roll = function(val) {
  24. Polycode.Rotation__set_roll(this.__ptr, val)
  25. }
  26. Duktape.fin(Rotation.prototype, function (x) {
  27. if (x === Rotation.prototype) {
  28. return;
  29. }
  30. Polycode.Rotation__delete(x.__ptr)
  31. })