AABB.js 935 B

123456789101112131415161718192021222324252627282930313233343536
  1. function AABB() {
  2. if(arguments[0] != "__skip_ptr__") {
  3. this.__ptr = Polycode.AABB()
  4. }
  5. Object.defineProperties(this, {
  6. 'min': { enumerable: true, configurable: true, get: AABB.prototype.__get_min, set: AABB.prototype.__set_min},
  7. 'max': { enumerable: true, configurable: true, get: AABB.prototype.__get_max, set: AABB.prototype.__set_max}
  8. })
  9. }
  10. AABB.prototype.__get_min = function() {
  11. var retVal = new Vector3()
  12. retVal.__ptr = Polycode.AABB__get_min(this.__ptr)
  13. return retVal
  14. }
  15. AABB.prototype.__set_min = function(val) {
  16. Polycode.AABB__set_min(this.__ptr, val.__ptr)
  17. }
  18. AABB.prototype.__get_max = function() {
  19. var retVal = new Vector3()
  20. retVal.__ptr = Polycode.AABB__get_max(this.__ptr)
  21. return retVal
  22. }
  23. AABB.prototype.__set_max = function(val) {
  24. Polycode.AABB__set_max(this.__ptr, val.__ptr)
  25. }
  26. Duktape.fin(AABB.prototype, function (x) {
  27. if (x === AABB.prototype) {
  28. return;
  29. }
  30. Polycode.AABB__delete(x.__ptr)
  31. })