2
0

AABB.js 862 B

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